shujingyang-db commented on code in PR #44318: URL: https://github.com/apache/spark/pull/44318#discussion_r1437189334
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/xml/XmlInferSchema.scala: ########## @@ -534,4 +541,55 @@ class XmlInferSchema(options: XmlOptions, caseSensitive: Boolean) } } } + + /** + * This helper function merges the data type of value tags and inner elements. + * It could only be structure data. Consider the following case, + * <a> + * value1 + * <b>1</b> + * value2 + * </a> + * Input: ''a struct<b int, _VALUE string>'' and ''_VALUE string'' + * Return: ''a struct<b int, _VALUE array<string>>'' + * @param objectType inner elements' type + * @param valueTagType value tag's type + */ + private[xml] def addOrUpdateValueTagType( + objectType: DataType, + valueTagType: DataType): DataType = { + (objectType, valueTagType) match { + case (st: StructType, _) => + // TODO(shujing): case sensitive? Review Comment: Thanks for answering this question! I create a Jira ticket for it -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org