-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-17905] [SQL] [TEST] Added test cases for InMemoryRelation #15462
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
Conversation
|
Test build #66884 has finished for PR 15462 at commit
|
|
Jenkins, retest this please |
|
Test build #66889 has finished for PR 15462 at commit
|
andrewor14
left a comment
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.
@kiszk This looks good, a few minor code organization comments.
|
|
||
| assert(inMemoryRelation.cachedColumnBuffers.getStorageLevel == storageLevel) | ||
| inMemoryRelation.cachedColumnBuffers.collect().head match { | ||
| case _: CachedBatch => assert(true) |
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 need to do assert true here
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.
i see
|
|
||
| test("all data type w && w/o nullability") { | ||
| // all primitives | ||
| Seq(true, false).map { nullability => |
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.
can you split these into 2 separate tests? It's more debuggable that way. I would use a private helper method to abstract the logic
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.
OK. I created smaller multiple tests
|
|
||
| test("access only some column of the all of columns") { | ||
| val df = spark.range(1, 100).map(i => (i, (i + 1).toFloat)).toDF("i", "f").cache | ||
| df.count |
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.
please be explicit with the actions here count(), cache()
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.
Done
| checkAnswer(df, row) | ||
| } | ||
|
|
||
| withSQLConf(SQLConf.WHOLESTAGE_MAX_NUM_FIELDS.key -> "2") { |
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.
similarly can you split these into multiple smaller unit tests?
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.
I see
|
|
||
| setupTestData() | ||
|
|
||
| def cachePrimitiveTest(data: DataFrame, dataType: String) { |
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.
minor: private def
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.
done
|
retest this please |
|
Test build #69025 has finished for PR 15462 at commit
|
|
Test build #69138 has finished for PR 15462 at commit
|
|
@andrewor14 thank you for your review. Could you please see it again? |
|
LGTM, merging into master 2.1 thanks. |
## What changes were proposed in this pull request? This pull request adds test cases for the following cases: - keep all data types with null or without null - access `CachedBatch` disabling whole stage codegen - access only some columns in `CachedBatch` This PR is a part of #15219. Here are motivations to add these tests. When #15219 is enabled, the first two cases are handled by specialized (generated) code. The third one is a pitfall. In general, even for now, it would be helpful to increase test coverage. ## How was this patch tested? added test suites itself Author: Kazuaki Ishizaki <[email protected]> Closes #15462 from kiszk/columnartestsuites.
|
@kiszk is there a JIRA associated specifically with adding tests for |
|
Thank you for pointing out an JIRA issue. I made a correction to a JIRA entry. |
|
Done. Corrected the JIRA. Thanks! |
## What changes were proposed in this pull request? This pull request adds test cases for the following cases: - keep all data types with null or without null - access `CachedBatch` disabling whole stage codegen - access only some columns in `CachedBatch` This PR is a part of apache#15219. Here are motivations to add these tests. When apache#15219 is enabled, the first two cases are handled by specialized (generated) code. The third one is a pitfall. In general, even for now, it would be helpful to increase test coverage. ## How was this patch tested? added test suites itself Author: Kazuaki Ishizaki <[email protected]> Closes apache#15462 from kiszk/columnartestsuites.
## What changes were proposed in this pull request? This pull request adds test cases for the following cases: - keep all data types with null or without null - access `CachedBatch` disabling whole stage codegen - access only some columns in `CachedBatch` This PR is a part of apache#15219. Here are motivations to add these tests. When apache#15219 is enabled, the first two cases are handled by specialized (generated) code. The third one is a pitfall. In general, even for now, it would be helpful to increase test coverage. ## How was this patch tested? added test suites itself Author: Kazuaki Ishizaki <[email protected]> Closes apache#15462 from kiszk/columnartestsuites.
What changes were proposed in this pull request?
This pull request adds test cases for the following cases:
CachedBatchdisabling whole stage codegenCachedBatchThis PR is a part of #15219. Here are motivations to add these tests. When #15219 is enabled, the first two cases are handled by specialized (generated) code. The third one is a pitfall.
In general, even for now, it would be helpful to increase test coverage.
How was this patch tested?
added test suites itself