Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update
  • Loading branch information
panbingkun committed Nov 13, 2024
commit 4ab91ecbd952f6014327bd190f43b68c4027fdce
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ case class SchemaOfXml(

override def nullable: Boolean = false

@transient
private lazy val xmlOptions = new XmlOptions(options, "UTC")

@transient
private lazy val xmlInferSchema = {
if (xmlOptions.parseMode == DropMalformedMode) {
throw QueryCompilationErrors.parseModeUnsupportedError("schema_of_xml", xmlOptions.parseMode)
}
new XmlInferSchema(xmlOptions, caseSensitive = SQLConf.get.caseSensitiveAnalysis)
}

@transient
private lazy val xml = child.eval().asInstanceOf[UTF8String]

Expand All @@ -190,17 +201,6 @@ case class SchemaOfXml(
override protected def withNewChildInternal(newChild: Expression): SchemaOfXml =
copy(child = newChild)

@transient
private lazy val xmlOptions = new XmlOptions(options, "UTC")

@transient
private lazy val xmlInferSchema = {
if (xmlOptions.parseMode == DropMalformedMode) {
throw QueryCompilationErrors.parseModeUnsupportedError("schema_of_xml", xmlOptions.parseMode)
}
new XmlInferSchema(xmlOptions, caseSensitive = SQLConf.get.caseSensitiveAnalysis)
}

@transient private lazy val xmlInferSchemaObjectType = ObjectType(classOf[XmlInferSchema])

override def replacement: Expression = StaticInvoke(
Expand Down