Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix unit test. (Have to change the error message to follow the existi…
…ng pattern
  • Loading branch information
siying committed Jun 30, 2023
commit 9e02f325ac1dc06be7aa2f8c54c48777205c18ff
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ object UnsupportedOperationChecker extends Logging {
}
}.mkString(", ")
throw new AnalysisException(
s"Unsupported window function in $windowFuncs. Structured " +
"Streaming only supports time-window aggregation using the `window` function. " +
s"(window specification: '$windowSpec')",
s"Window function is not supported in $windowFuncs on streaming DataFrames/Datasets. " +
"Structured Streaming only supports time-window aggregation using the `window` " +
s"function. (window specification: '$windowSpec')",
subPlan.origin.line,
subPlan.origin.startPosition)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,10 @@ class UnsupportedOperationsSuite extends SparkFunSuite with SQLHelper {
testUnaryOperatorInStreamingPlan(
"sample", Sample(0.1, 1, true, 1L, _), expectedMsg = "sampling")
testUnaryOperatorInStreamingPlan(
"window", Window(Nil, Nil, Nil, _), expectedMsg = "non-time-based windows")
"window",
Window(Nil, Nil, Nil, _),
expectedMsg =
"Structured Streaming only supports time-window aggregation using the `window` function")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to avoid the dependency from the error message format?


// Output modes with aggregation and non-aggregation plans
testOutputMode(Append, shouldSupportAggregation = false, shouldSupportNonAggregation = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ class StreamSuite extends StreamTest {
.start()
}
assert(e.getMessage.contains(
"Unsupported window function in 'row_number()' as column 'rn_col'"))
"Window function is not supported in 'row_number()' as column 'rn_col'"))
}


Expand Down