Uh oh!
There was an error while loading. Please reload this page.
[SPARK-22672][SQL][TEST] Refactor ORC Tests - #19882
Conversation
dongjoon-hyun
commented
Dec 4, 2017
Hi, @cloud-fan , @gatorsmile , @HyukjinKwon , @viirya . |
SparkQA
commented
Dec 5, 2017
Test build #84443 has finished for PR 19882 at commit
|
HyukjinKwon
commented
Dec 5, 2017
Whoa big class list. Will take a look soon within tomorrow as well. |
dongjoon-hyun
commented
Dec 5, 2017
Thank you so much, @HyukjinKwon ! |
There was a problem hiding this comment.
Thank you for review, @viirya . I'll update tomorrow.
cloud-fan
commented
Dec 5, 2017
Instead of having |
It has more lines, doesn't it? In any way, we need helper functions. |
cloud-fan
commented
Dec 5, 2017
ok maybe have a It can avoid changing the test code from |
dongjoon-hyun
commented
Dec 5, 2017
Okay. No problem. Thanks, @cloud-fan . |
There was a problem hiding this comment.
Let HiveOrcFilterSuite extend OrcFilterSuite?
There was a problem hiding this comment.
Ur, it's impossible because of the reason I mentioned in PR description.
OrcFilterSuite and HiveOrcFilterSuite cannot reuse test cases due to the different function signatures using Hive 1.2.1 ORC classes and Apache ORC 1.4.1 classes.
There was a problem hiding this comment.
Could we leave some comments to explain that reason?
Seems there are many duplications and I would wonder why.
SparkQA
commented
Dec 6, 2017
Test build #84524 has finished for PR 19882 at commit
|
There was a problem hiding this comment.
the new ORC didn't change these config names?
There was a problem hiding this comment.
Yes. In fact, Apache ORC doesn't have this params.
There was a problem hiding this comment.
why does this test not in native orc test?
There was a problem hiding this comment.
Native ORC solve this bug. Native ORC have a corresponding test case here.
+ test("Schema discovery on empty ORC files") {
+ // SPARK-8501 is fixed.
There was a problem hiding this comment.
then why don't we put this test in the base class?
There was a problem hiding this comment.
This only works in new OrcFileFormat.
- The new test case is in
OrcQuerySuitefor new OrcFileFormat. - And, the old test case is
HiveOrcQuerySuitefor old OrcFileFormat.
There was a problem hiding this comment.
Sure. It just comes from the original test case.
There was a problem hiding this comment.
Would we need this test case for Hive's one too?
There was a problem hiding this comment.
Old OrcFileFormat fails on this test case.
Do you mean adding an exception-catching test case?
There was a problem hiding this comment.
Oh, I overlooked. Sure, that's fine.
There was a problem hiding this comment.
Mind if I ask where this is needed?
There was a problem hiding this comment.
The test cases of OrcSuite assume these tables.
dongjoon-hyun
commented
Dec 6, 2017
It's rebased to the master to resolve conflicts. Also, I addressed the comments. Thanks! |
HyukjinKwon
left a comment
There was a problem hiding this comment.
Loosely related though, should we maybe rename org.apache.spark.sql.hive.orc.Orc* -> org.apache.spark.sql.hive.orc.HiveOrc* in the main codes too to distinguish the newer ORC from the old Hive ORC?
There was a problem hiding this comment.
Could we leave some comments to explain that reason?
Seems there are many duplications and I would wonder why.
There was a problem hiding this comment.
I wrote the original tests here like this using toString partly because ExpressionTree (SearchArgument.getExpression) it's inaccessible and the string format is easy to read.
Although I think that tree seems available in the ORC, I think it's okay to keep the tests like this. It's easy to read but let's fix up the comments here. It doesn't look about Hive anyway here.
There was a problem hiding this comment.
Yep, I'll remove the comment. For the test case, I agree with you. And also this string tests will be consistent with Hive Orc tests for a while.
HyukjinKwon
commented
Dec 7, 2017
LGTM BTW. |
SparkQA
commented
Dec 7, 2017
Test build #84581 has finished for PR 19882 at commit
|
dongjoon-hyun
commented
Dec 7, 2017
Thank you so much, @HyukjinKwon ! |
@HyukjinKwon . The PR code and description is updated like the followings.
The main reason I used prefix As you see in the PR description, we need to use |
I actually suggested similarly before: but I remember I received an advise at that time and it became as below: After rethinking it, I realised this is better. Likewise, I actually liked |
HyukjinKwon
commented
Dec 7, 2017
I meant in #19882 (review), I liked this |
dongjoon-hyun
commented
Dec 7, 2017
Oh. I'll bring back. |
This reverts commit 1828571.
HyukjinKwon
commented
Dec 7, 2017
I am sorry, I had to clarify this ahead .. |
dongjoon-hyun
commented
Dec 7, 2017
Definitely, my bad. For the main code, we can do later in a separate PR if needed. I hope this PR contains tests only. |
SparkQA
commented
Dec 7, 2017
Test build #84589 has finished for PR 19882 at commit
|
SparkQA
commented
Dec 7, 2017
Test build #84591 has finished for PR 19882 at commit
|
HyukjinKwon
commented
Dec 7, 2017
retest this please |
SparkQA
commented
Dec 7, 2017
Test build #84599 has finished for PR 19882 at commit
|
cloud-fan
commented
Dec 7, 2017
thanks, merging to master! |
dongjoon-hyun
commented
Dec 7, 2017
Thank you so much, @cloud-fan , @HyukjinKwon , and @gatorsmile ! |
## What changes were proposed in this pull request? During #19882, `conf` is mistakenly used to switch ORC implementation between `native` and `hive`. To affect `OrcTest` correctly, `spark.conf` should be used. ## How was this patch tested? Pass the tests. Author: Dongjoon Hyun <dongjoon@apache.org> Closes#19931 from dongjoon-hyun/SPARK-22672-2.
What changes were proposed in this pull request?
Since SPARK-20682, we have two
OrcFileFormats. This PR refactors ORC tests with three principles (with a few exceptions)sql/core.HiveXXXtest suite insql/hiveby reusingsql/coretest suite.OrcTestwill provide common helper functions andval orcImp: String.Test Suites
Native OrcFileFormat
Hive built-in OrcFileFormat
Hierarchy
Please note the followings.
OrcHadoopFsRelationSuitedoesn't inheritOrcTest. It is insidesql/hivelikeParquetHadoopFsRelationSuitedue to the dependencies and follows the existing convention to useval dataSourceName: StringOrcFilterSuites cannot reuse test cases due to the different function signatures using Hive 1.2.1 ORC classes and Apache ORC 1.4.1 classes.How was this patch tested?
Pass the Jenkins tests with reorganized test suites.