-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24322][BUILD] Upgrade Apache ORC to 1.4.4 #21372
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| package org.apache.spark.sql.execution.datasources.orc | ||
|
|
||
| import java.io.File | ||
| import java.sql.Timestamp | ||
| import java.util.Locale | ||
|
|
||
| import org.apache.orc.OrcConf.COMPRESS | ||
|
|
@@ -169,6 +170,14 @@ abstract class OrcSuite extends OrcTest with BeforeAndAfterAll { | |
| } | ||
| } | ||
| } | ||
|
|
||
| test("SPARK-24322 Fix incorrect workaround for bug in java.sql.Timestamp") { | ||
| withTempPath { path => | ||
| val ts = Timestamp.valueOf("1900-05-05 12:34:56.000789") | ||
| Seq(ts).toDF.write.orc(path.getCanonicalPath) | ||
| checkAnswer(spark.read.orc(path.getCanonicalPath), Row(ts)) | ||
| } | ||
| } | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the test case for ORC-306 and update the PR title.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does that mean the Hive ORC reader works, but the native ORC reader has the bug?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please explicitly set hive reader to native for this test.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I missed this comments. Hive ORC and ORC MR reader doesn't have this bug because it uses
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
| class OrcSourceSuite extends OrcSuite with SharedSQLContext { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Apache ORC 1.4.4, ORC-306 fixes this according to the original definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know when this issue was introduced in ORC?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is on TreeReaderFactory.java. From Apache ORC project, the prior code is ORC-1 which was the initial importing code from Hive two years ago.
Effectively, the writer side is the same. Only, reader side is changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OrcHadoopFsRelationSuitecovers this changes via end-to-end write and read test cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my understanding, ORC-306 changes the query result, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ORC-306 changes the content of exposed ORC column vectors in reader side. The interpretation is Spark's logic as we see in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying no external impact of ORC-306?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, what I mean is, with ORC-306 and this fix, there is no external impact outside Spark. More specifically, outside
OrcColumnVector/OrcColumnarBatchReader. In other words, ORC 1.4.4 cannot be used with Apache Spark without this patch.Java
Timestamp.getTimeandTimestamp.getNanohas an overlap by definition. Previously, ORC didn't stick to the definition.