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

   ### Version
   
   1.3.x / branch-1.3 (Iceberg 1.11.0). `main` already maps these types 
correctly in `FromIcebergType`.
   
   ### Describe what's wrong
   
   A format-version 3 table created through the Iceberg REST catalog is 
reported by the Gravitino API with column types that differ from the table 
schema:
   
   | Iceberg type | Gravitino column type |
   |---|---|
   | `timestamp_ns` | `{"type":"external","catalogString":"TIMESTAMP_NANO"}` |
   | `timestamptz_ns` | same as above (zone flag lost) |
   | `geometry(EPSG:4326)` | `{"type":"external","catalogString":"GEOMETRY"}` 
(CRS dropped) |
   | `geography(OGC:CRS84, karney)` | 
`{"type":"external","catalogString":"GEOGRAPHY"}` (CRS/algorithm dropped) |
   | `unknown` | `{"type":"external","catalogString":"UNKNOWN"}` |
   | `variant` | table load fails with 501 `Unsupported type: variant` |
   
   Root cause: `FromIcebergType.primitive` falls through to `ExternalType` for 
v3 type ids, and `variant(...)` is not overridden so Iceberg's `SchemaVisitor` 
throws.
   
   ### Error message and/or stacktrace
   
   ```
   GET /api/metalakes/.../tables/<table-with-variant>
   501 UnsupportedOperationException: Unsupported type: variant
   
   timestamp_ns / timestamptz_ns both become ExternalType(TIMESTAMP_NANO)
   geometry/geography lose CRS (and algorithm)
   ```
   
   ### How to reproduce
   
   1. Create a format-version 3 table through IRC with `timestamp_ns`, 
`timestamptz_ns`, `geometry(EPSG:4326)`, `geography(OGC:CRS84, karney)`, and 
`unknown` columns.
   2. Load the table through the Gravitino REST API and compare column types.
   3. Create another v3 table with a `variant` column and load it: 501.
   
   ### Additional context
   
   Expected: v3 types map to Gravitino types that keep precision/zone, 
CRS/algorithm, `variant`, and `unknown` (as `NullType`), so the table remains 
governable. The same mapping already exists on `main`; this tracks the bug for 
1.3.x and the backport.


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