cloud-fan commented on code in PR #42462:
URL: https://github.com/apache/spark/pull/42462#discussion_r1296713510
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExprUtils.scala:
##########
@@ -117,4 +117,26 @@ object ExprUtils extends QueryErrorsBase {
TypeCheckSuccess
}
}
+
+ /**
+ * Check if the schema is valid for XML
+ *
+ * @param schema The schema to check.
+ * @return
+ * `TypeCheckSuccess` if the schema is valid
+ * `DataTypeMismatch` with an error error if the schema is not valid
+ */
+ def checkXmlSchema(schema: DataType): TypeCheckResult = {
+ val isInvalid = schema.existsRecursively {
+ case MapType(keyType, _, _) if keyType != StringType => true
Review Comment:
can we add some comments to explain the rationale of only allowing string
type map key?
--
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]