2162174202-sudo opened a new issue, #18504:
URL: https://github.com/apache/iceberg/issues/18504

   ### Apache Iceberg version
   
   1.8.1
   
   ### Query engine
   
   Flink
   
   ### Please describe the bug 🐞
   
   ### Environment
   
   - Apache Flink 1.19.1
   - `iceberg-flink-runtime-1.19-1.8.1`
   - Iceberg format-version 2 table
   - Flink batch execution mode
   - Iceberg REST catalog with S3-compatible storage (MinIO)
   
   ### Steps to reproduce
   
   Run the following statements in order in a Flink SQL client. The REST catalog
   configuration uses example endpoints and redacted credentials.
   
   ```sql
   SET 'execution.runtime-mode' = 'batch';
   
   CREATE CATALOG iceberg WITH (
     'type' = 'iceberg',
     'catalog-type' = 'rest',
     'uri' = 'http://iceberg-rest:8181',
     'warehouse' = 's3://warehouse/wh/',
     'io-impl' = 'org.apache.iceberg.aws.s3.S3FileIO',
     's3.endpoint' = 'http://minio:9000',
     's3.path-style-access' = 'true',
     's3.access-key-id' = '<MINIO_ACCESS_KEY>',
     's3.secret-access-key' = '<MINIO_SECRET_KEY>'
   );
   
   USE CATALOG iceberg;
   
   CREATE TABLE lakediff_array_pushdown (
     id BIGINT NOT NULL,
     tags ARRAY<STRING>
   ) WITH (
     'format-version' = '2'
   );
   
   INSERT INTO lakediff_array_pushdown VALUES
     (1, ARRAY['new', 'mobile']),
     (2, ARRAY['paid']),
     (3, CAST(NULL AS ARRAY<STRING>));
   ```
   
   The control query succeeds:
   
   ```sql
   SELECT id,
          CASE WHEN tags IS NULL THEN NULL ELSE CARDINALITY(tags) END AS tag_cnt
   FROM lakediff_array_pushdown
   ORDER BY id;
   ```
   
   Control result:
   
   ```text
   1  2
   2  1
   3  NULL
   ```
   
   Adding the array-column predicate causes the failure:
   
   ```sql
   SELECT id,
          CASE WHEN tags IS NULL THEN NULL ELSE CARDINALITY(tags) END AS tag_cnt
   FROM lakediff_array_pushdown
   WHERE tags IS NOT NULL
   ORDER BY id;
   ```
   
   ### Expected behavior
   
   The filtered query returns:
   
   ```text
   1  2
   2  1
   ```
   
   ### Actual behavior
   
   The query fails with:
   
   ```text
   java.lang.ClassCastException: Cannot cast 
org.apache.flink.table.data.GenericArrayData to java.util.List
   ```
   
   Catalog creation, table creation, and insertion succeeded, and the insert job
   finished. The control query returned the rows shown above. The filtered query
   failed with the same exception on three consecutive executions.
   
   No external dataset is needed; the SQL above creates the test data.
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [x] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to