You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT ARRAY_AGG(e.rateORDER BYe.sn)
FROM sales_global AS s
JOIN exchange_rates AS e
ONs.currency=e.currency_fromANDe.currency_to='USD'ANDs.ts>=e.tsGROUP BYs.snORDER BYs.sn;
gives the error. When working in multi partitions. External error: query failed: DataFusion error: Arrow error: Compute error: Sort not supported for list type Decimal128(10, 2)
I have examined the bug. Above query produces following physical plan
+ ProjectionExec: expr=[ARRAY_AGG(e.rate) ORDER BY [e.snASC NULLS LAST]@0as ARRAY_AGG(e.rate)]
+--SortPreservingMergeExec: [sn@1 ASC NULLS LAST]+----SortExec: expr=[sn@1 ASC NULLS LAST]+------ProjectionExec: expr=[ARRAY_AGG(e.rate) ORDER BY [e.sn ASC NULLS LAST]@1 as ARRAY_AGG(e.rate), sn@0 as sn]+--------AggregateExec: mode=FinalPartitioned, gby=[sn@0 as sn], aggr=[ARRAY_AGG(e.rate)]+----------SortExec: expr=[sn@1 ASC NULLS LAST]+------------CoalesceBatchesExec: target_batch_size=8192+--------------RepartitionExec: partitioning=Hash([sn@0], 8), input_partitions=8+----------------AggregateExec: mode=Partial, gby=[sn@0 as sn], aggr=[ARRAY_AGG(e.rate)], ordering_mode=None+------------------SortExec: expr=[sn@1 ASC NULLS LAST]+--------------------ProjectionExec: expr=[sn@0 as sn, sn@3 as sn, rate@6 as rate]+----------------------CoalesceBatchesExec: target_batch_size=8192+------------------------HashJoinExec: mode=Partitioned, join_type=Inner, on=[(currency@2, currency_from@2)], filter=ts@0 >= ts@1+--------------------------CoalesceBatchesExec: target_batch_size=8192+----------------------------RepartitionExec: partitioning=Hash([currency@2], 8), input_partitions=8+------------------------------RepartitionExec: partitioning=RoundRobinBatch(8), input_partitions=1+--------------------------------MemoryExec: partitions=1, partition_sizes=[1]+--------------------------CoalesceBatchesExec: target_batch_size=8192+----------------------------RepartitionExec: partitioning=Hash([currency_from@2], 8), input_partitions=8+------------------------------ProjectionExec: expr=[sn@0 as sn, ts@1 as ts, currency_from@2 as currency_from, rate@4 as rate]+--------------------------------CoalesceBatchesExec: target_batch_size=8192+----------------------------------FilterExec: currency_to@3 = USD+------------------------------------MemoryExec: partitions=8, partition_sizes=[1, 0, 0, 0, 0, 0, 0, 0]
The reason of the error is that AggregateExec: mode=FinalPartitioned requires its input to be sorted by e.sn as in AggregateExec: mode=Partial. Column sn@1 is valid for the input AggregateExec: mode=Partial. However, this column is no longer valid for AggregateExec: mode=FinalPartitioned. at index 1 we have array_agg result.
To Reproduce
No response
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Assume we following tables.
and
The following query
gives the error. When working in multi partitions.
External error: query failed: DataFusion error: Arrow error: Compute error: Sort not supported for list type Decimal128(10, 2)
I have examined the bug. Above query produces following physical plan
The reason of the error is that
AggregateExec: mode=FinalPartitioned
requires its input to be sorted bye.sn
as inAggregateExec: mode=Partial
. Columnsn@1
is valid for the inputAggregateExec: mode=Partial
. However, this column is no longer valid forAggregateExec: mode=FinalPartitioned
. at index 1 we have array_agg result.To Reproduce
No response
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: