maropu commented on a change in pull request #26319:
URL: https://github.com/apache/spark/pull/26319#discussion_r518551221
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
##########
@@ -543,6 +543,13 @@ object ScalaReflection extends ScalaReflection {
throw new UnsupportedOperationException(s"`$fieldName` is a
reserved keyword and " +
"cannot be used as field name\n" + walkedTypePath)
}
+ // It is ok to use head here because a variable name needs to be non
empty
+ if (!Character.isJavaIdentifierStart(fieldName.head)) {
+ throw new UnsupportedOperationException(s"`$fieldName` is a word
that starts with" +
+ " a character not allowed in Java and cannot be used as field
name. " +
Review comment:
nit: to follow the other existing messages, could you put a space at the
end of strings?
```
throw new UnsupportedOperationException(s"`$fieldName` is a word
that starts with " +
"a character not allowed in Java and cannot be used as field
name. " +
^^
```
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]