Skip to content

Commit 31d3a8a

Browse files
cloud-fanHyukjinKwon
authored andcommitted
[SPARK-41708][SQL][TEST][FOLLOWUP] Match non-space chars in path string
### What changes were proposed in this pull request? This is a followup of #39610 . The non-greedy mode does not work well if the ending class name appears more than once, like `file://myPath/.../clsName/.../clsName`. We should still use greedy mode, but to match any chars that are not space or comma (comma is used to combine multiple paths in `FileIndex.toString`). ### Why are the changes needed? make the test framework more stable ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? N/A Closes #39924 from cloud-fan/minor. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org> (cherry picked from commit 04550ed) Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent 508b800 commit 31d3a8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ trait SQLQueryTestHelper {
4141
.replaceAll(
4242
s"Location.*$clsName/",
4343
s"Location $notIncludedMsg/{warehouse_dir}/")
44-
.replaceAll(s"file:.*?$clsName", s"file:$notIncludedMsg/{warehouse_dir}")
44+
.replaceAll(s"file:[^\\s,]*$clsName", s"file:$notIncludedMsg/{warehouse_dir}")
4545
.replaceAll("Created By.*", s"Created By $notIncludedMsg")
4646
.replaceAll("Created Time.*", s"Created Time $notIncludedMsg")
4747
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")

0 commit comments

Comments
 (0)