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
Now let me check line 176 in ProjectionItem.java which looked odd in grep output:
- Assistant
Now the implementation. First,
QueryPlanningInfo: - Assistant
Now
SelectExecutionPlanner: - Assistant
Now
ExpandStep: - Assistant
Now compile and run the tests:
- Assistant
All 14 pass. Now run the related tests that could be affected:
- Assistant
All tests pass. The fix is complete.
Summary
Root cause: When a projection is an
expand(),SelectExecutionPlanner.optimizeQueryreplaces it with the inner expression viagetExpandContent(), which drops theASalias.ExpandStepthen hardcoded the property name"value"for expanded scalar values.Changes (3 files, plus tests):
engine/src/main/java/com/arcadedb/query/sql/executor/QueryPlanningInfo.java- addedexpandAliasfield (also propagated incopy()).engine/src/main/java/com/arcadedb/query/sql/executor/SelectExecutionPlanner.java:699- captures the explicit alias from the expand projection item before it is replaced by the expand content, and passes it toExpandStepin .
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.