tabular-io / iceberg-kafka-connect

Apache License 2.0
177 stars 32 forks source link

Case sensitivity of columns #163

Closed 13535048320 closed 7 months ago

13535048320 commented 8 months ago

When I create a table using Spark-SQL, the column names are all uppercase letters, and the connector runs normally. However, when using Trino to create a table, the column names are all lowercase letters, and the connector will throw an exception, and all data is null.

Table demo created using trino.

CREATE TABLE demo (
  VBELN varchar
) WITH (
    format = 'PARQUET',
    location = 's3a://uat-warehouse/demo.db'
);

image

Table ods_zpp004 created using spark sql. This is running normally.

CREATE TABLE IF NOT EXISTS `ODS_ZPP004` (
  `AUFNR`  STRING  COMMENT "Order" 
)
USING iceberg
TBLPROPERTIES ('format-version'='2')
COMMENT 'Issue order info' ;

image

"iceberg.tables.default-id-columns": "VBELN" image

image

bryanck commented 8 months ago

I opened a PR to add case-insensitive lookups of columns during record conversion, to handle this case where the column name cases between the Kafka record and Iceberg schema don't match.

bryanck commented 7 months ago

The fix has been merged, feel free to reopen this if your issue is not resolved in the latest release.