zhangyue19921010 opened a new issue, #11359:
URL: https://github.com/apache/paimon/issues/11359

   ### Search before asking
   
   - [x] I searched the issues and found no report of the same array subscript 
problem.
   
   ### Paimon version
   
   2.2-SNAPSHOT, commit 8d704811cb40a7193f0daf73a5d278f10e65e4b6.
   
   ### Compute Engine
   
   Hive 2.3.10, JDK 11.
   
   ### Minimal reproduce step
   
   Create an ordinary append table with `id INT, arr ARRAY<INT>`, no primary 
key, and `bucket=-1`. Write rows `(1, [10, NULL, 30])`, `(2, [])`, and `(3, 
NULL)`, then register it with `org.apache.paimon.hive.PaimonStorageHandler`.
   
   Run a direct projection:
   
   ```sql
   SELECT id, arr[-1], arr[0], arr[1], arr[2], arr[3], arr[4] FROM 
external_table;
   ```
   
   The regression uses the Paimon table writer, Avro files, and an embedded 
Hive query against the external table.
   
   ### What doesn't meet your expectations?
   
   The query fails while evaluating `arr[-1]`, with 
`ArrayIndexOutOfBoundsException` from 
`PaimonListObjectInspector.getListElement`. Hive's standard list inspector 
returns NULL for indices outside the array bounds. Valid indices and NULL 
elements should retain their values.
   
   ### Anything else?
   
   The direct projection uses Hive's fetch path and reaches the Paimon list 
inspector.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to