Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Design and Implement CoderLogicalType #23374

Open
Abacn opened this issue Sep 26, 2022 · 0 comments
Open

[Feature Request]: Design and Implement CoderLogicalType #23374

Abacn opened this issue Sep 26, 2022 · 0 comments

Comments

@Abacn
Copy link
Contributor

Abacn commented Sep 26, 2022

What would you like to happen?

It was mentioned in #7865 that a CoderLogicalType could enable any existing Coder to be used as a Schema field. In particular, the micros_millis and decimal logical types are made to be compatible with existing datetime and decimal java fieldtype, and they do not fit in the beam portable logical type representations. Currently they are treated as special cases with a representation that is not quite true:

// Special-case for DATETIME and DECIMAL which are logical types in portable representation,

For example,
here DATETIME has a representation of FieldType.INT64, but FieldType.INT64 is decoded with VarIntCoder, different from the actually used BigEndianLongCoder.
here DECIMAL has a representation of FieldType.BYTES, but the actually used BigDecimalCoder encoded a VarInt and a Bytes.

Introducing CoderLogicalType and specify the coder to the logical type's payload could clarify this issue.

Issue Priority

Priority: 2

Issue Component

Component: cross-language

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants