[SPARK-36312][SQL][FOLLOWUP] Add back ParquetSchemaConverter.checkFieldNames
### What changes were proposed in this pull request? Add back ParquetSchemaConverter.checkFieldNames() ### Why are the changes needed? Fix code ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Closes #33552 from AngersZhuuuu/SPARK-36312-FOLLOWUP. Authored-by: Angerszhuuuu <angers.zhu@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
This commit is contained in:
parent
86f44578e5
commit
f086c17b8e
|
@ -591,6 +591,16 @@ private[sql] object ParquetSchemaConverter {
|
|||
}
|
||||
}
|
||||
|
||||
def checkFieldNames(schema: StructType): Unit = {
|
||||
schema.foreach { field =>
|
||||
checkFieldName(field.name)
|
||||
field.dataType match {
|
||||
case s: StructType => checkFieldNames(s)
|
||||
case _ =>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def checkConversionRequirement(f: => Boolean, message: String): Unit = {
|
||||
if (!f) {
|
||||
throw new AnalysisException(message)
|
||||
|
|
Loading…
Reference in a new issue