You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2026/01/29 17:38:59 UTC

[I] GetArrayItem returns wrong results (off-by-one index) [datafusion-comet]

andygrove opened a new issue, #3330:
URL: https://github.com/apache/datafusion-comet/issues/3330

   ## Description
   
   The `get_array_item.sql` SQL file test reveals incorrect results from the native `GetArrayItem` implementation.
   
   ## Expected vs Actual
   
   ```
   == Correct Answer ==      == Spark Answer ==
   struct<arr[idx]:int>      struct<arr[idx]:int>
   [10]                      [10]
   [1]                       [10]   <-- wrong
   [20]                      [1]
   [30]                      [20]
   [null]                    [30]
   [null]                    [null]
   ```
   
   The results are shifted — it appears the first row's value is duplicated and subsequent rows use the previous row's index. This suggests an off-by-one or stale-index bug in the native `GetArrayItem` evaluation.
   
   ## Reproduction
   
   Run `CometSqlFileTestSuite` — the `get_array_item.sql` test fails with both `parquet.enable.dictionary=false` and `true`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org