Skip to content

Fix ORC Logical types - #636

Open
jsims-slower wants to merge 4 commits into
confluentinc:masterfrom
jsims-slower:logical-types
Open

Fix ORC Logical types#636
jsims-slower wants to merge 4 commits into
confluentinc:masterfrom
jsims-slower:logical-types

Conversation

@jsims-slower

Copy link
Copy Markdown

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
Copy Markdown

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.

2 participants