-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-49246][SQL][TESTS][FOLLOWUP] Fix flaky CollationSuite #48031
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -947,7 +947,10 @@ class CollationSuite extends DatasourceV2SQLBase with AdaptiveSparkPlanHelper { | |
| withTable(table) { | ||
| sql(s"create table $table (a array<string collate utf8_lcase>) using parquet") | ||
| sql(s"insert into $table values (array('aaa')), (array('AAA'))") | ||
| checkAnswer(sql(s"select distinct a from $table"), Seq(Row(Seq("aaa")))) | ||
| val result = sql(s"select distinct a from $table").collect() | ||
| assert(result.length === 1) | ||
| val data = result.head.get(0).asInstanceOf[scala.collection.mutable.ArraySeq[String]] | ||
| assert(data === Array("aaa") || data === Array("AAA")) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so the test becomes flaky? Reading the test query I think both
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it becomes flaky. The returned value is not non-deterministic.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean just non-deterministic, I guess. |
||
| } | ||
| // map doesn't support aggregation | ||
| withTable(table) { | ||
|
|
@@ -968,7 +971,10 @@ class CollationSuite extends DatasourceV2SQLBase with AdaptiveSparkPlanHelper { | |
| withTable(table) { | ||
| sql(s"create table $table (s struct<fld:string collate utf8_lcase>) using parquet") | ||
| sql(s"insert into $table values (named_struct('fld', 'aaa')), (named_struct('fld', 'AAA'))") | ||
| checkAnswer(sql(s"select s.fld from $table group by s"), Seq(Row("aaa"))) | ||
| val result = sql(s"select s.fld from $table group by s").collect() | ||
| assert(result.length === 1) | ||
| val data = result.head.getString(0) | ||
| assert(data === "aaa" || data === "AAA") | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
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.
Updated, thanks!