Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Fix the Date and Timestamp import issue (#45). #46

Merged
merged 2 commits into from May 8, 2020

Conversation

morazow
Copy link
Contributor

@morazow morazow commented May 7, 2020

No description provided.

In the `3.1.0` version of Apache Hive, the JavaDateObjectInspector[0]
returns a Hive Date type instead of Java SQL Date type.

This breaks the import since Exasol cannot recognize (emit) Hive date
type, it expects a `java.sql.date`.

Similar issue with a timestamp type.

This commit fixes the issue by converting the Hive date and timestamp
values into their corresponding Java SQL counterparts. Additionally,
updates the Hadoop version to `3.0.0` and adds tests for type
conversions.

However, this breaks the backward compatibility, since we can only
support Hive version above `3.1.0`.

[0]: https://github.com/apache/hive/blob/rel/release-3.1.0/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/JavaDateObjectInspector.java#L39-L42
break;
case "java.sql.Date":
obj = Date.valueOf(value);
obj = java.sql.Date.valueOf(value);
break;
case "java.lang.Boolean":
obj = Boolean.valueOf(value);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can also add qualified names to other classes of this switch to make it consistent and clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Fixed.

@morazow morazow merged commit 741dc12 into develop May 8, 2020
@morazow morazow deleted the bug/#45-datetime-issues branch October 14, 2020 13:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants