You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/11 00:27:34 UTC

[GitHub] [spark] 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

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org