Untitled conversation
- User
[SQL] "expand" projection is always named "value" ignoring "AS"
ArcadeDB Server v26.5.1 (build b6d08fee549dd5930303b362223869901aab0fac/1778533954349/main)Running on Linux 6.17.0-29-generic - OpenJDK 64-Bit Server VM 25.0.3-eaUsing
expandin a projection, the result-set contains an property namedvalueinspite an alias of the formAS x:SELECT expand([1,2,3,4]) AS testresults in:
{"result":[{"value":1},{"value":2},{"value":3},{"value":4}]}Interface
No new interfaces are introduced.
- Assistant
I'll investigate how SQL
expandprojections handle aliases and fix the bug soASis respected. - Assistant
Reproducing the bug, then applying fixes in
ExpandStepandProjectionItem.getExpandContent(). - Assistant
The bug had two causes in the expand pipeline.
Root cause
ProjectionItem.getExpandContent()stripped theASalias when the planner peeled off theexpand()wrapper, so the inner projection was computed without the user-defined name.ExpandStephardcoded"value"when wrapping primitive elements from an expanded collection, instead of using the projection property name.
Fix
- Preserve
aliasingetExpandContent()soSELECT expand([1,2,3,4]) AS testprojects undertest. - Track
expandPropertyNameinExpandStepfrom the incoming row and use it when materializing each expanded primitive value.
Verification
Added
shouldExpandInlineArrayWithAliasinExpandStepTest.SELECT expand([1,2,3,4]) AS testnow returns:{"result":[{"test":1},{"test":2},{"test":3},{"test":4}]}ExpandStepTestandExpandParseTestboth pass.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →
- fable-5Compare side by side →