Repository navigation
Conversation
difin
marked this pull request as ready for review
December 1, 2026 12:59
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changes were proposed in this pull request?
Support for GEOMETRY data type and a shared base for GEOGRAPHY data type that will be developed later.
This PR implements the following aspects of the GEOMETRY data type support:
type system
GEOMETRY is a primitive type (GeospatialTypeInfo base class plus GeometryTypeInfo), with type strings like geometry and geometry('EPSG:3857').
Object inspectors and the serde, lazy and lazybinary paths support it.
The metastore's ColumnType accepts it, and non-Iceberg tables reject it.
DDL and the compiler
GEOMETRY / GEOMETRY('crs') in the grammar as a non-reserved keyword, the type string from the parse tree, and the Calcite mapping.
BINARY → GEOMETRY conversion for INSERT and CAST.
Partition columns, partition transforms and sort order are rejected.
Iceberg schema mapping
Mapping to and from Iceberg's Types.GeometryType with its CRS. Default values are rejected.
reading and writing
Iceberg object inspector, Deserializer, HiveValueConverter, vectorization and the Parquet vectorized reader.
Parquet only. ORC tables are rejected at CREATE and ALTER.
Phase 5: HiveServer2 and JDBC
TTypeId.GEOMETRY_TYPE, the Thrift Type mapping, ColumnValue/ColumnBuffer and JdbcColumn. Clients receive raw WKB as java.sql.Types.BINARY.
Added today: protocol version V13 and the JDBC and TestColumnBuffer tests.
h3. Not included (follow-ups)
** The existing functions use the ESRI shape format, not WKB, so they don't accept GEOMETRY directly yet.
** Workaround: ST_GeomFromWKB(CAST(g AS BINARY)) to read, and CAST(ST_AsBinary(...) AS GEOMETRY) to write.
** Iceberg already writes geometry bounding boxes for Hive writes, but Hive doesn't use them to prune files.
** This is blocked until Iceberg exposes spatial predicates in its public expression API.
Why are the changes needed?
Iceberg v3 has GEOMETRY data type. This PR adds support for this data type in Hive.
Does this PR introduce any user-facing change?
Yes. New GEOMETRY data type that can be used in Hive for Iceberg tables.
How was this patch tested?
New unit and query tests.