[
https://issues.apache.org/jira/browse/FLINK-40807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ramin Gharib closed FLINK-40807.
--------------------------------
Fix Version/s: 2.5.0
Release Note:
Adds the XML_STRING function, the inverse of PARSE_XML. The Table API method is
VARIANT.xmlString() and the Python method is xml_string().
PARSE_XML(XML_STRING(v)) returns v for any v from PARSE_XML with the same
force_array, and XML_STRING(PARSE_XML(xml)) returns the normalized document.
Fields with an @ prefix are written as attributes, the $ field as text, and the
other fields as child elements, in the order of the # field. A NULL is written
with xsi:nil="true", and a scalar other than a string or a UUID gets an
xsi:type with the xs prefix, such as xsi:type="xs:int". XML_STRING fails if the
VARIANT has no XML representation, for example if it isn't an object with a
single field for the root element.
PARSE_XML also changes compared to 2.4.0. An xsi:type of base64Binary is read
as BYTES. The declarations xmlns:xsi and xmlns:xs are dropped only if they bind
the XML Schema namespaces, so <r xmlns:xs="http://www.w3.org/2001/XMLSchema">
no longer maps to an @xmlns:xs field, and a declaration with another namespace
is kept as an attribute. A dateTime whose offset moves it past the year 9999 in
UTC stays a STRING.
Resolution: Fixed
> Add XML_STRING() function
> -------------------------
>
> Key: FLINK-40807
> URL: https://issues.apache.org/jira/browse/FLINK-40807
> Project: Flink
> Issue Type: Sub-task
> Reporter: Moritz Manner
> Assignee: Moritz Manner
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.5.0
>
>
> Adds the XML_STRING function from
> [FLIP-612|https://cwiki.apache.org/confluence/spaces/FLINK/pages/451974259/FLIP-612+Native+XML+Functions+for+Flink+SQL].
> It converts a VARIANT produced by PARSE_XML back into an XML string, so that
> parsing the result again returns the same VARIANT. See the FLIP for the
> details.
> This also adds Table API and PyFlink support.
> {code:java}
> XML_STRING(variant) → STRING{code}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)