Parsing

PARSE_JSON

Parse a string with JSON document.

Syntax:

PARSE_JSON[<type>](<string>)

For example:

PARSE_JSON[record(a: double)]("""{"a": 1.0}""") // (a: 1.0)

IS_JSON

Checks if a string is a valid JSON document. Can also take an optional argument to know if the JSON is of a particular type.

Syntax:

IS_JSON(<string>)
IS_JSON[<type>](<string>)

For example:

IS_JSON("""{"a": 1.0}""") // true
IS_JSON[collection(int)]("""{"a": 1.0}""") // false

Attention

IS_JSON currently not implemented.

PARSE_XML

Parse a string with XML document.

Syntax:

PARSE_XML[<type>](<string>)

For example:

PARSE_XML[record(a: double)]("""<a>1.0</a>""") // (a: 1.0)

IS_XML

Checks if a string is a valid XML document. Can also take an optional argument to know if the XML is of a particular type.

Syntax:

IS_XML(<string>)
IS_XML[<type>](<string>)

For example:

IS_XML("""<a>1.0</a>""") // true
IS_XML[collection(int)]("""<a>1.0</a>""") // false

Attention

IS_XML currently not implemented.

PARSE_CSV

Parse a string with CSV document.

Syntax:

PARSE_CSV[type](<string>, <separator>)

For example:

PARSE_CSV[record(_1: string, _2: string)]("""a|1.0
b|2.0""", "|", 2) // [("a", "1.0"), ("b", "2.0")]

IS_CSV

Checks if a string is a valid CSV document. Can also take an optional argument to know if the CSV is of a particular type.

Syntax:

IS_CSV(<string>)
IS_CSV[<type>](<string>)

For example:

IS_CSV("""a|1.0""") // true

Parses a string with a CSV document.