Add DATE/TIME/DATETIME to portable LogicalTypes.Enum in schema.proto#37870
Add DATE/TIME/DATETIME to portable LogicalTypes.Enum in schema.proto#37870brucearctor wants to merge 1 commit intoapache:masterfrom
Conversation
Add DATE (epoch days, INT64), TIME (nanoseconds, INT64), and DATETIME (ROW<Date: INT64, Time: INT64>) as standard portable logical types in the schema proto definition. These logical types already exist in the Java SDK (SqlTypes.DATE, SqlTypes.TIME, SqlTypes.DATETIME) with portable URNs but were never added to LogicalTypes.Enum, preventing cross-language recognition. This is the first step toward full portable Date/Time support, unblocking IcebergIO Date type usage from the Python SDK. Fixes: apache#37823 See also: apache#25946, apache#28359
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces standard portable logical types for DATE, TIME, and DATETIME into the schema.proto definition. This crucial update addresses the current limitation where existing Java SDK date/time types degrade to UnknownLogicalType during cross-language serialization, thereby enabling proper recognition and interoperability. This change is a foundational step towards full portable Date/Time support, specifically unblocking the use of IcebergIO date types from the Python SDK. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
|
Assigning reviewers: R: @shunping added as fallback since no labels match configuration Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Summary
Add
DATE,TIME, andDATETIMEas standard portable logical types inLogicalTypes.Enuminschema.proto.Motivation
The Java SDK already defines Date, Time, and DateTime logical types (
SqlTypes.DATE/TIME/DATETIME) usingjava.timewith portable URNs (beam:logical_type:date:v1, etc.), but these were never added to the proto'sLogicalTypes.Enum. This means they can't be recognized as standard types during cross-language serialization — they degrade toUnknownLogicalType.This is the first step toward full portable Date/Time support, which will unblock IcebergIO date type usage from the Python SDK.
Changes
DATE = 8— epoch days as INT64 (matchingDate.java)TIME = 9— nanoseconds as INT64 (matchingTime.java)DATETIME = 10— ROW<Date: INT64, Time: INT64> (matchingDateTime.java)Follow-up PRs
SchemaTranslation.STANDARD_LOGICAL_TYPES(Java)JdbcUtil.javato recognize the portable URNs alongside legacy identifiersRelated Issues