-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-6844][SQL] Clean up accumulators used in InMemoryRelation when it is uncached #5475
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 #30085 has finished for PR 5475 at commit
|
|
Thanks for working on this and for adding a test! I have two issues with the way this is being implemented:
The ones inside of the table scan are clearly harder to deal with, but perhaps we can just make those lazy vals that are only initialized during testing due to some conf being set? |
|
Thanks for commenting. For the first issue, I have registered the accumulators of table scan For the second one, I have tried doing this without a global hash map. However, because the cache manager will call |
|
Test build #30108 has finished for PR 5475 at commit
|
|
I see, thanks for clarifying. It seems bad that we are creating accumulators per copy anyway then. Can we just pass in the accumulator with the buffers and statistics instead so that there is only ever one copy? Honestly, the best solution would probably be to make the For the second part, it would be great if we could just get rid of the accumulators completely. It feels bad to have all this extra logic only for a test. Can you think of any other way that we could test this? |
|
Because the statistics are obtained lazily, the above doesn't work. I put the accumulator in the following array that is propagated to following relations. The following relations will not allocate new accumulators if the array is propagated. The accumulators in Will update codes later. |
|
For |
|
ok. updated. |
|
Test build #30290 has finished for PR 5475 at commit
|
|
Test build #30291 has finished for PR 5475 at commit
|
|
Thanks! Merged to master. |
Added in apache#5475. Pointed as broken in apache#5639. /cc marmbrus Author: Liang-Chi Hsieh <[email protected]> Closes apache#5640 from viirya/fix_cached_test and squashes the following commits: c0cf69a [Liang-Chi Hsieh] Fix broken cached test.
Added in apache#5475. Pointed as broken in apache#5639. /cc marmbrus Author: Liang-Chi Hsieh <[email protected]> Closes apache#5640 from viirya/fix_cached_test and squashes the following commits: c0cf69a [Liang-Chi Hsieh] Fix broken cached test.
Added in apache#5475. Pointed as broken in apache#5639. /cc marmbrus Author: Liang-Chi Hsieh <[email protected]> Closes apache#5640 from viirya/fix_cached_test and squashes the following commits: c0cf69a [Liang-Chi Hsieh] Fix broken cached test.
| // Enable in-memory partition pruning | ||
| setConf(SQLConf.IN_MEMORY_PARTITION_PRUNING, "true") | ||
| // Enable in-memory table scan accumulators | ||
| setConf("spark.sql.inMemoryTableScanStatistics.enable", "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.
Why not setting spark.sql.inMemoryTableScanStatistics.enable back false in afterAll?
| val accsSize = Accumulators.originals.size | ||
|
|
||
| sql("SELECT key FROM testData LIMIT 10").registerTempTable("t1") | ||
| sql("SELECT key FROM testData LIMIT 5").registerTempTable("t2") |
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.
We also need to drop these two temp views after tests
JIRA: https://issues.apache.org/jira/browse/SPARK-6844