spark
spark copied to clipboard
[SPARK-40495] [SQL] [TESTS] Add additional tests to StreamingSessionWindowSuite
What changes were proposed in this pull request?
Add complex tests to StreamingSessionWindowSuite. Concretely, I created two helper functions,
- one is called
sessionWindowQueryNestedKey, which would convertsessionIdfrom the single word key used insessionWindowQueryto a nested column key. For example:"hello" -> (("hello", "hello"), "hello"). - The other is called
sessionWindowQueryMultiColKey. It would convertsessionIdfrom the single word key used insessionWindowQueryto two columns. For example: "hello" -> col1: ("hello", "hello"), col2: "hello"
With the two new helper functions, I added more tests for the tests for complete mode and cap gap duration (append and async state was not included, because the first two is enough for testing the change I added). The logic of the tests are not changed at all, just the key.
For the aggregation test (session window - with more aggregation functions), I added some more functions as well as a UDAF to test, and I tried first() and last() function on a nested triple, created using the same method as the above.
How was this patch tested?
All are tests.
Let's file a JIRA and link it to the PR title, see also https://spark.apache.org/contributing.html
Thanks for the suggestion! I've update the title with ticket number. But I'm not particularly sure what to put Affects Version/s at the original JIRA ticket, please correct me if I'm wrong!
https://github.com/WweiL/oss-spark/runs/8461474730 GA build failed, looks like scalastyle failure. Could you please fix it? Thanks in advance!
Can one of the admins verify this patch?
@WweiL GA build unfortunately caught the unused import. Could you please run mvn clean install -DskipTests and dev/scalastyle and make sure both pass, before pushing a new commit? Thanks in advance.
https://github.com/WweiL/oss-spark/actions/runs/3147828316/jobs/5117724962
GA build still complains. Could you please run mvn clean install -DskipTests and make sure there is no error before pushing a new change?
Thanks! Merging to master.
Thanks @WweiL for the contribution! I merged this to master.