Repository navigation
Conversation
antiguru
added this pull request to stack #38942
September 24, 2026 08:52
antiguru
force-pushed
the
sqlfunc-convert-record
branch
from
September 24, 2026 10:14
8fb9b56 to
ab71954
Compare
antiguru
force-pushed
the
sqlfunc-convert-map
branch
from
September 24, 2026 10:14
b75c5a0 to
a5afb0b
Compare
antiguru
force-pushed
the
sqlfunc-convert-map
branch
from
September 24, 2026 14:29
a5afb0b to
a669946
Compare
antiguru
force-pushed
the
sqlfunc-convert-record
branch
from
September 24, 2026 14:29
ab71954 to
165fb4f
Compare
antiguru
force-pushed
the
sqlfunc-convert-map
branch
from
September 25, 2026 16:00
a669946 to
923e52e
Compare
antiguru
force-pushed
the
sqlfunc-convert-record
branch
from
September 25, 2026 16:00
165fb4f to
6eb1536
Compare
antiguru
force-pushed
the
sqlfunc-convert-map
branch
from
October 14, 2026 09:11
923e52e to
b1f46ff
Compare
antiguru
force-pushed
the
sqlfunc-convert-record
branch
from
October 14, 2026 09:11
6eb1536 to
5663ac0
Compare
Both impls checked NULL in the body, which under the macro has to come from the input type. `CastRecordToString` was hand-written because it allocates its result, which the eager trait now covers: a `String` output is pushed into the arena by `OutputDatumType::into_result`. Its input is `ExcludeNull<Datum<'a>>`, because `stringify_datum` takes a raw `Datum` and a bare `Datum` accepts NULL. `ExcludeNull` reports `nullable() == false`, so the derived `propagates_nulls` is true, matching the declaration, and its `try_from_result` turns `Datum::Null` into `Err(Ok(Datum::Null))`, which the evaluation layer returns as `Ok(Datum::Null)`. `introduces_nulls` derives false from the `String` inside the `Result`. `output_sql_type` returned `String.nullable(input_type.nullable)`, which the derived output plus the unary tail gives for a non-nullable input, so no output modifier is needed. `preserves_uniqueness = true` carries over, `could_error` derives true from the fallible output, and `inverse`, `is_monotone` and `is_eliminable_cast` returned the trait defaults and are dropped. The `TODO?` on `inverse` now sits on the function. `Display` wrote a fixed string, so `sqlname` reproduces it. `RecordGet` allocates nothing and returns a field borrowed from its input, so its output is a bare `Datum<'a>` and it takes no arena. Its input is `DatumList<'a>`, which is what the body unwrapped the record to; `DatumList` reports `nullable() == false` on its own, so no `ExcludeNull` wrapper is needed and the derived `propagates_nulls` is true. `RecordGet`'s `output_sql_type` reads the input, so it becomes an `output_type_expr` that returns the selected field's column type. The hand-written version also ORed `input_type.nullable` onto that type, which the unary tail now does, so the expression drops the term. `introduces_nulls` derives true from the bare `Datum` output, which is what the impl declared. The output is a bare `Datum`, from which `could_error` would derive false, so the modifier pins the `true` the impl declared by inheriting `LazyUnaryFunc`'s conservative default. `preserves_uniqueness`, `inverse`, `is_monotone` and `is_eliminable_cast` returned the trait defaults and are dropped, and its `Display` formats the field index, so it stays hand-written under `skip_display = true`. `func_registry_records_sqlfunc_sources` used `record_get` as its example of a function with no recorded source. It now has one, so the assertion moves to `extract_interval`. The registry reports only `sqlfunc_signature` moving, on both records. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
antiguru
force-pushed
the
sqlfunc-convert-map
branch
from
October 14, 2026 15:18
b1f46ff to
e61cc4e
Compare
antiguru
force-pushed
the
sqlfunc-convert-record
branch
from
October 14, 2026 15:18
5663ac0 to
3cfd255
Compare
antiguru
removed this pull request from stack #38942
October 14, 2026 15:45
Member
Author
|
Folded into #39062, which now carries all twenty file conversions as separate commits, per review feedback to land them as one PR. Posted by Claude Code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts
CastRecordToStringandRecordGetto#[sqlfunc].CastRecordToStringallocates its result, which the arena passed toEagerUnaryFunc::callnow covers, and its NULL check moves into itsExcludeNull<Datum<'a>>input.RecordGettakes aDatumList<'a>and returns the selected field, with anoutput_type_exprthat gives that field's column type. It keeps thecould_error = truethe old impl inherited, which #39814 drops.func_registry_records_sqlfunc_sourcesusedrecord_getas its example of a function with no recorded source, so it switches toextract_interval. The registry reports onlysqlfunc_signaturemoving, on both records.Based on #39093.
🤖 Generated with Claude Code