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:sqlSELECT expand([1,2,3,4]) AS testresults in:
json{"result":[{"value":1},{"value":2},{"value":3},{"value":4}]}Interface
No new interfaces are introduced.
- Assistant
I'll trace how SQL
expandprojections handle aliases and find where the result column is forced tovalue. - Assistant
Reproducing the bug, then tracing how the projection alias is lost before
ExpandStep. - Assistant
I'll add a regression test, then fix alias preservation in
getExpandContent()and use the projection property name inExpandStepinstead of hardcoded"value". - Assistant
Fixed.
expandprojections were ignoringASaliases for scalar values due to two issues:- Alias dropped during planning -
ProjectionItem.getExpandContent()stripped theASalias when the planner extracted the inner expression for expand. - Hardcoded property name -
ExpandStepalways wrapped scalar expanded values under"value"instead of using the projection property name.
Changes
ProjectionItem.getExpandContent()- preserve the explicit alias when building the inner projection:173:179:engine/src/main/java/com/arcadedb/query/sql/parser/ProjectionItem.java - Alias dropped during planning -
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.