laserninja opened a new issue, #13159:
URL: https://github.com/apache/gravitino/issues/13159

   ### Version
   
   main branch (reproduced at 5a9ee9aba; relevant code checked against upstream 
9d6a881698)
   
   ### Describe what's wrong
   
   A valid PostgreSQL table containing CHAR(5)[] cannot be loaded through the 
JDBC catalog table operations. Array element conversion loses the length 
metadata needed by the bpchar converter.
   
   ### Error message and/or stacktrace
   
   ```text
   NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because 
the return value of "JdbcTypeBean.getColumnSize()" is null
   ```
   
   ### How to reproduce
   
   In PostgreSQL, execute `CREATE TABLE audit.char_array (v CHAR(5)[]);` and 
`INSERT INTO audit.char_array VALUES (ARRAY['hello','world']::CHAR(5)[]);`. 
Initialize PostgreSqlTableOperations against that database and call 
`load("audit", "char_array")`. PostgreSQL accepts the table and values, but 
catalog loading throws the exception above. Expected: successfully describe the 
table using a faithful supported or external representation.
   
   ### Additional context
   
   Reproduced with a live isolated PostgreSQL 18 instance and JDBC 42.7.11. 
`toGravitinoArrayType` constructs an element JdbcTypeBean using only the type 
name, then BPCHAR unboxes a null column size. Preserve valid element type 
metadata or provide a faithful fallback. Reviewed PostgreSQL converter PRs 
#10970 and #12083; neither fixes this array path.
   
   Source: 
`catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/converter/PostgreSqlTypeConverter.java:176`.
   


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