spark icon indicating copy to clipboard operation
spark copied to clipboard

[SPARK-40495] [SQL] [TESTS] Add additional tests to StreamingSessionWindowSuite

Open WweiL opened this issue 3 years ago • 3 comments

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 convert sessionId from the single word key used in sessionWindowQuery to a nested column key. For example: "hello" -> (("hello", "hello"), "hello").
  • The other is called sessionWindowQueryMultiColKey. It would convert sessionId from the single word key used in sessionWindowQuery to 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.

WweiL avatar Sep 19 '22 23:09 WweiL

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!

WweiL avatar Sep 20 '22 06:09 WweiL

https://github.com/WweiL/oss-spark/runs/8461474730 GA build failed, looks like scalastyle failure. Could you please fix it? Thanks in advance!

HeartSaVioR avatar Sep 21 '22 07:09 HeartSaVioR

Can one of the admins verify this patch?

AmplabJenkins avatar Sep 21 '22 12:09 AmplabJenkins

@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.

HeartSaVioR avatar Sep 27 '22 09:09 HeartSaVioR

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?

HeartSaVioR avatar Sep 29 '22 03:09 HeartSaVioR

Thanks! Merging to master.

HeartSaVioR avatar Sep 29 '22 08:09 HeartSaVioR

Thanks @WweiL for the contribution! I merged this to master.

HeartSaVioR avatar Sep 29 '22 08:09 HeartSaVioR