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

Fix ORC Logical types #636

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jsims-slower
Copy link

Problem

Many Logical types don't work when writing ORC.
And when a hierarchal Record comes through, logical types are ignored entirely (convertPrimitiveMaybeLogical() is never called during recursive traversal), including DECIMAL.
Bug where hierarchal (not flattened) Kafka Connect records aren't converted to OrcStructs correctly.

Solution

Code changes to identify and serialize Kafka Connect Logical Types correctly, for: Date, Time and Timestamp and Decimal.
By default, parse all Logical types.

This PR should not be merged directly, and the following things need to be done:

  1. Consider keeping the original DECIMAL Precision value. Currently Scale is propagated, but Precision is discarded, and a hard-coded value of 38 is used instead.
  2. Unit tests were not updated/fixed
  3. The HiveSchemaConverter is deep within a shared library, so instead of fixing that class, and new class was created: HiveSchemaConverterWithLogicalTypes. The fixes should be made to the original class, and the new class should not be used.
Does this solution apply anywhere else?
  • yes
  • no
If yes, where?

Test Strategy

Testing done:
  • Unit tests
  • Integration tests
  • System tests
  • Manual tests

Release Plan

…OrcStruct. Added support to create DATE, TIMESTAMP and INT values from KafkaConnect Date, Timestamp and Time respectively.
…hrough, not the field TypeInfo. Update comments. Fix related Test. Fix codestyle warnings.
@jsims-slower jsims-slower requested a review from a team as a code owner November 18, 2022 20:17
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

None yet

2 participants