File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
sql/core/src/main/scala/org/apache/spark/sql/parquet Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -405,11 +405,15 @@ private[parquet] object ParquetTypesConverter extends Logging {
405405 }
406406 }
407407
408- def checkSpecialCharacters (schema : Seq [Attribute ]) = {
408+ private def checkSpecialCharacters (schema : Seq [Attribute ]) = {
409409 // ,;{}()\n\t= and space character are special characters in Parquet schema
410- if (schema.exists(_.name.matches(" .*[ ,;{}()\n\t =].*" ))) {
411- sys.error(""" Attribute name can not contain any character among " ,;{}()\n\t=".
412- | Use Alias to rename attribute name""" .stripMargin)
410+ schema.map(_.name).foreach { name =>
411+ if (name.matches(" .*[ ,;{}()\n\t =].*" )) {
412+ sys.error(
413+ s """ Attribute name " $name" contains invalid character(s) among " ,;{}()\n\t=".
414+ |Please use alias to rename it.
415+ """ .stripMargin.split(" \n " ).mkString(" " ))
416+ }
413417 }
414418 }
415419
You can’t perform that action at this time.
0 commit comments