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 existing tests for expand:
- Assistant
Single call site. Now implement. First
ExpandStep: - Assistant
Now
QueryPlanningInfo: - Assistant
Now the planner - capture the alias and pass it to
ExpandStep: - Assistant
Import is there. Compile and run the tests:
- Assistant
All 8 pass. Now run the broader tests that touch expand:
- Assistant
All green. One more batch of connected tests (MATCH queries commonly wrap
expand()): - Assistant
The
ScriptExecutionTesterror is pre-existing and environmental, unrelated to this change: the test callswithTotalBuckets(Runtime.getRuntime().availableProcessors())(ScriptExecutionTest.java:277) and this machine has 128 CPUs, exceeding the hard limit of 32 buckets inTypeBuilder. Nothing in the expand path is involved.Summary
The bug: when the planner detects an expand projection,
optimizeQueryreplaced the projection withgetExpandContent(), which drops theASalias, andExpandStephardcoded the property name"value"for expanded scalar items.Changes:
SelectExecutionPlanner.java(optimizeQuery, ~line 699): capture the explicit alias from the expand projection item intoinfo.expandAliasbefore swapping in the expand content;handleExpandnow passes it to the step.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.