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
Identifieris already imported. NowExpandStep: - Assistant
Now compile and run the tests:
- Assistant
All 36 pass (13 in ExpandStepTest including the 3 new ones). Now a broader sweep of tests that exercise expand and the select planner:
- Assistant
Fixed. All tests pass: 36 in the expand-specific suites plus 387 across the broader SQL execution suites that use
expand(), with zero failures.Changes
Root cause: the alias on
expand(...) AS xwas silently dropped in two places: the planner replaced the projection with the expand content (discarding the outer item's alias), andExpandStephardcoded"value"as the property name when wrapping expanded scalar items.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-optimizeQuerynow captures the explicit alias from the expand projection item before swapping in the expand content, andhandleExpandpasses it to the step.engine/src/main/java/com/arcadedb/query/sql/executor/ExpandStep.java- new constructor taking the alias; scalar values are wrapped under the alias when present, falling back to otherwise. The no-alias constructor is kept for compatibility.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.