Is there a way to parse XML tags in BigQuery Standard SQL?

Jonny Brooks

I have read that it's a bad idea to parse XML/HTML using regular expressions. The alternative suggestion is to use an XML parser. Does one exist in the BigQuery Standard SQL library?

Lisa Yin

Here is the documentation to how to use Javascript UDFs in BigQuery like Elliot has mentioned.

https://cloud.google.com/bigquery/docs/reference/standard-sql/user-defined-functions

I imagine the UDF might look something like

CREATE TEMPORARY FUNCTION XML(x STRING)
RETURNS STRING
  LANGUAGE js AS """
  var data = fromXML(x);
  return data.title;
"""
OPTIONS(
library="gs://<BUCKET_NAME>/from-xml.min.js"
);
SELECT XML(a) FROM UNNEST(["<title>Title of Page</title>"]) as a

Where from-xml.min.js is from this library and loaded into your gcs account

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Quantiles function in BigQuery Standard SQL

分類Dev

Unable to parse xml in GO with : in tags

分類Dev

Is there a way to parse XML with Purescript?

分類Dev

How to generate series in BigQuery Standard SQL

分類Dev

BigQuery standard SQL query returns a wrong answer

分類Dev

Parse certain XML tags sequentially using ElementTree

分類Dev

standard way of adding html data attribute in html tags?

分類Dev

Correct way to parse XML using Simple Framework

分類Dev

How to use string functions in the ON clause of a LEFT JOIN with standard SQL in BigQuery?

分類Dev

Getting SQL XML tags to show with NULL values

分類Dev

What is the SQL standard way to limit the number of return values?

分類Dev

Is it possible to schedule queries in Google BigQuery using standard SQL such that date range increments everyday while it runs?

分類Dev

BigQuery - Failed to parse input string

分類Dev

Store Date in XML tags

分類Dev

Writing xml tags with SimpleXml

分類Dev

Vim and Syntastic with non-standard HTML tags

分類Dev

Output of SQL Server table contents in one line with trailing total contains unwanted XML tags

分類Dev

Is there a standard way of discarding input in Rust?

分類Dev

Parse XML with Python lxml

分類Dev

BIRT parse XML with XPath

分類Dev

Parse XML in Go

分類Dev

Parse XML to Array with SimpleXML

分類Dev

Parse xml type file

分類Dev

Parse xml dom to an object

分類Dev

Parse xml to multiple Classes

分類Dev

How to parse complex xml

分類Dev

BigQuery Standard SQLで配列のスライスを取得するにはどうすればよいですか?

分類Dev

SQL Server parse XML to table - multiple node with the same name and first node should be table columns

分類Dev

Google BigQuery Standard SQL-IN句はBigQueryで機能しますが、コマンドラインでは機能しません

Related 関連記事

  1. 1

    Quantiles function in BigQuery Standard SQL

  2. 2

    Unable to parse xml in GO with : in tags

  3. 3

    Is there a way to parse XML with Purescript?

  4. 4

    How to generate series in BigQuery Standard SQL

  5. 5

    BigQuery standard SQL query returns a wrong answer

  6. 6

    Parse certain XML tags sequentially using ElementTree

  7. 7

    standard way of adding html data attribute in html tags?

  8. 8

    Correct way to parse XML using Simple Framework

  9. 9

    How to use string functions in the ON clause of a LEFT JOIN with standard SQL in BigQuery?

  10. 10

    Getting SQL XML tags to show with NULL values

  11. 11

    What is the SQL standard way to limit the number of return values?

  12. 12

    Is it possible to schedule queries in Google BigQuery using standard SQL such that date range increments everyday while it runs?

  13. 13

    BigQuery - Failed to parse input string

  14. 14

    Store Date in XML tags

  15. 15

    Writing xml tags with SimpleXml

  16. 16

    Vim and Syntastic with non-standard HTML tags

  17. 17

    Output of SQL Server table contents in one line with trailing total contains unwanted XML tags

  18. 18

    Is there a standard way of discarding input in Rust?

  19. 19

    Parse XML with Python lxml

  20. 20

    BIRT parse XML with XPath

  21. 21

    Parse XML in Go

  22. 22

    Parse XML to Array with SimpleXML

  23. 23

    Parse xml type file

  24. 24

    Parse xml dom to an object

  25. 25

    Parse xml to multiple Classes

  26. 26

    How to parse complex xml

  27. 27

    BigQuery Standard SQLで配列のスライスを取得するにはどうすればよいですか?

  28. 28

    SQL Server parse XML to table - multiple node with the same name and first node should be table columns

  29. 29

    Google BigQuery Standard SQL-IN句はBigQueryで機能しますが、コマンドラインでは機能しません

ホットタグ

アーカイブ