cloud-fan commented on code in PR #37407:
URL: https://github.com/apache/spark/pull/37407#discussion_r980967098
##########
sql/core/src/test/scala/org/apache/spark/sql/DatasetUnpivotSuite.scala:
##########
@@ -137,48 +138,49 @@ class DatasetUnpivotSuite extends QueryTest
assert(unpivoted.schema === longSchema)
checkAnswer(unpivoted, longDataRows)
- val unpivoted2 = wideDataDs.select($"id", $"str1", $"str2")
- .unpivot(
- Array($"id"),
- Array.empty,
- variableColumnName = "var",
- valueColumnName = "val")
- assert(unpivoted2.schema === longSchema)
- checkAnswer(unpivoted2, longDataRows)
+ val e = intercept[AnalysisException] {
+ wideDataDs.select($"id", $"str1", $"str2")
+ .unpivot(
+ Array($"id"),
+ Array.empty,
+ variableColumnName = "var",
+ valueColumnName = "val")
+ }
+ checkError(
+ exception = e,
+ errorClass = "UNPIVOT_REQUIRES_VALUE_COLUMNS",
Review Comment:
nvm, people should call the other overload if they want Spark to infer value
columns.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]