Uh oh!
There was an error while loading. Please reload this page.
[SPARK-22187][SS] Update unsaferow format for saved state in flatMapGroupsWithState to allow timeouts with deleted state - #21739
[SPARK-22187][SS] Update unsaferow format for saved state in flatMapGroupsWithState to allow timeouts with deleted state#21739tdas wants to merge 11 commits into
Conversation
| def asNullable: DataType = this | ||
| override def simpleString: String = cls.getName | ||
| override def simpleString: String = s"Object[${cls.getName}]" |
There was a problem hiding this comment.
this is to make it differentiate between IntegerType and ObjectType with int in it. Both show up in the simpleStreaing as int.
SparkQA
commented
Jul 9, 2018
Test build #92766 has finished for PR 21739 at commit
|
SparkQA
commented
Jul 10, 2018
Test build #92790 has finished for PR 21739 at commit
|
tdas
commented
Jul 11, 2018
jenkins retest this please |
SparkQA
commented
Jul 11, 2018
Test build #92836 has finished for PR 21739 at commit
|
| } | ||
| private class StateManagerImplV2( |
There was a problem hiding this comment.
Add docs explaining the state format
SparkQA
commented
Jul 11, 2018
Test build #92853 has finished for PR 21739 at commit
|
SparkQA
commented
Jul 11, 2018
Test build #92845 has finished for PR 21739 at commit
|
SparkQA
commented
Jul 11, 2018
Test build #92846 has finished for PR 21739 at commit
|
tdas
commented
Jul 11, 2018
zsxwing
commented
Jul 12, 2018
LGTM |
SparkQA
commented
Jul 19, 2018
Test build #93258 has finished for PR 21739 at commit
|
zsxwing
commented
Jul 19, 2018
LGTM again |
What changes were proposed in this pull request?
Currently, the group state of user-defined-type is encoded as top-level columns in the UnsafeRows stores in the state store. The timeout timestamp is also saved as (when needed) as the last top-level column. Since the group state is serialized to top-level columns, you cannot save "null" as a value of state (setting null in all the top-level columns is not equivalent). So we don't let the user set the timeout without initializing the state for a key. Based on user experience, this leads to confusion.
This PR is to change the row format such that the state is saved as nested columns. This would allow the state to be set to null, and avoid these confusing corner cases. However, queries recovering from existing checkpoint will use the previous format to maintain compatibility with existing production queries.
How was this patch tested?
Refactored existing end-to-end tests and added new tests for explicitly testing obj-to-row conversion for both state formats.