Skip to content

Commit

Permalink
[SPARK-36312][SQL][FOLLOWUP] Add back ParquetSchemaConverter.checkFie…
Browse files Browse the repository at this point in the history
…ldNames

### 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>
  • Loading branch information
AngersZhuuuu authored and cloud-fan committed Jul 28, 2021
1 parent 86f4457 commit f086c17
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f086c17

Please sign in to comment.