cloud-fan commented on a change in pull request #33441:
URL: https://github.com/apache/spark/pull/33441#discussion_r676525896
##########
File path:
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala
##########
@@ -153,6 +154,27 @@ private[sql] class AvroFileFormat extends FileFormat
}
override def supportDataType(dataType: DataType): Boolean =
AvroUtils.supportsDataType(dataType)
+
+ override def supportFieldName(name: String): Unit = {
+ val length = name.length
+ if (length == 0) {
+ throw
QueryCompilationErrors.columnNameContainsInvalidCharactersError(name)
+ } else {
+ val first = name.charAt(0)
+ if (!Character.isLetter(first) && first != '_') {
Review comment:
do you have some reference doc to prove this is indeed a limitation of
avro? or can you run some local tests like `df.write.format("avro").save(path)`?
--
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]