beliefer commented on code in PR #43710:
URL: https://github.com/apache/spark/pull/43710#discussion_r1387422030
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/xml/XmlOptions.scala:
##########
@@ -66,7 +66,11 @@ private[sql] class XmlOptions(
val compressionCodec =
parameters.get(COMPRESSION).map(CompressionCodecs.getCodecClassName)
val rowTagOpt = parameters.get(XmlOptions.ROW_TAG).map(_.trim)
- require(!rowTagRequired || rowTagOpt.isDefined, s"'${XmlOptions.ROW_TAG}'
option is required.")
+
+ if (rowTagRequired && rowTagOpt.isEmpty) {
+ throw QueryCompilationErrors.xmlRowTagRequiredError(XmlOptions.ROW_TAG)
Review Comment:
if so, we should change `val rowTag =
rowTagOpt.getOrElse(XmlOptions.DEFAULT_ROW_TAG)` to `val rowTag = rowTagOpt.get`
--
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]