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
Now let me find existing expand tests to add a regression test:
- Assistant
Now the fix. First
ExpandStep: - Assistant
Now the planner:
- Assistant
Compile and run the tests:
- Assistant
All pass. Now run the broader connected tests that use expand:
- Assistant
All 258 tests pass. The fix is complete.
Summary
SELECT expand([1,2,3,4]) AS testnow returns{"test":1}, {"test":2}, ...instead of ignoring the alias and always usingvalue.Root cause: In
SelectExecutionPlanner.optimizeQuery, when an expand projection is detected the whole projection item (including itsASalias) is replaced by the inner expand content, so the alias was discarded.ExpandStepthen hardcoded"value"as the property name for expanded scalar values.Changes:
SelectExecutionPlanner.java:699-705- captures the explicit alias from the expand projection item before replacing it with the expand content, and passes it toExpandStepinhandleExpandQueryPlanningInfo.java- new field (also copied in )
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.