maropu commented on a change in pull request #28184: [SPARK-31416][SQL] Check
more strictly that a field name can be used as a valid Java identifier for
codegen
URL: https://github.com/apache/spark/pull/28184#discussion_r406991874
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
##########
@@ -1222,12 +1225,18 @@ class DatasetSuite extends QueryTest
assert(result == Set(ClassData("a", 1) -> null, ClassData("b", 2) ->
ClassData("x", 2)))
}
- test("better error message when use java reserved keyword as field name") {
+ test("better error message when use invalid java identifier as field name") {
val e = intercept[UnsupportedOperationException] {
Seq(InvalidInJava(1)).toDS()
}
assert(e.getMessage.contains(
- "`abstract` is a reserved keyword and cannot be used as field name"))
+ "`abstract` is not a valid identifier of Java and cannot be used as
field name"))
+
+ val e2 = intercept[UnsupportedOperationException] {
Review comment:
Could you add this test in a new test block instead of adding the existing
one? btw, it seems better to place these tests for `ScalaReflection` in
`ScalaReflectionRelationSuite`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]