Skip to content

[FLINK-xxxxx][table] Add GEOGRAPHY logical type support#28740

Draft
davidchaava wants to merge 1 commit into
apache:masterfrom
akvelon:task/add-geography-type
Draft

[FLINK-xxxxx][table] Add GEOGRAPHY logical type support#28740
davidchaava wants to merge 1 commit into
apache:masterfrom
akvelon:task/add-geography-type

Conversation

@davidchaava

Copy link
Copy Markdown

What is the purpose of the change

This pull request adds GEOGRAPHY as a logical type in the Table & SQL API.

The change introduces the core type plumbing required for Flink to recognize,
parse, serialize, validate, and carry GEOGRAPHY values through the table runtime.
This PR intentionally does not add geography SQL functions or Parquet format
support. Those parts are planned as follow-up changes.

Discussion thread:
https://lists.apache.org/thread/flbj8dfdfgs26klrxt7xch3r9785ky67

Brief change log

  • Added GEOGRAPHY as a new logical type root and introduced GeographyType.
  • Added DataTypes.GEOGRAPHY() for declaring GEOGRAPHY columns in the Java API.
  • Added SQL parser, logical type parser, and JSON serialization/deserialization support.
  • Added planner and Calcite type conversion support for GEOGRAPHY.
  • Added internal runtime support for carrying GEOGRAPHY values through row data.
  • Added binary row, row data, writer, and code generation integration.
  • Added GeographyTypeSerializer and serializer snapshot support.
  • Added validation for unsupported GEOGRAPHY conversions.

Verifying this change

This change added tests and can be verified as follows:

  • Added tests for DataTypes.GEOGRAPHY() and logical type parsing.
  • Added tests for logical type JSON serialization/deserialization.
  • Added tests for planner type conversion and validation behavior.
  • Added tests for binary GEOGRAPHY data handling.
  • Added serializer compatibility tests through SerializerTestBase.
  • Extended row data and row serializer tests to cover GEOGRAPHY values.
  • Extended type serializer coverage checks for the new serializer.

Does this pull request potentially affect one of the following parts:

  • Dependencies: no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes
  • The serializers: yes
  • The runtime per-record code paths: yes
  • Anything that affects deployment or recovery: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? JavaDocs and follow-up documentation PR

Follow-up changes

The following parts are intentionally left out of this PR:

  • GEOGRAPHY SQL constructor/accessor functions such as ST_*.
  • PyFlink exposure for GEOGRAPHY schemas.
  • Parquet dependency upgrade.
  • Parquet GEOGRAPHY serialization and schema mapping.

@flinkbot

flinkbot commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@gkalashyan-akv gkalashyan-akv force-pushed the task/add-geography-type branch from 8bdd2b6 to 677d908 Compare July 15, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants