A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.databricks.com/aws/en/sql/language-manual/functions/json_tuple below:

json_tuple table-valued generator function | Databricks Documentation

json_tuple table-valued generator function

Applies to: Databricks SQL Databricks Runtime

Returns multiple JSON objects as a tuple.

Syntax​
json_tuple(jsonStr, path1 [, ...] )
Arguments​ Returns​

A single row composed of the JSON objects.

If any object cannot be found, NULL is returned for that object.

Examples​

Applies to: Databricks Runtime 12.1 and earlier:

SQL

> SELECT json_tuple('{"a":1, "b":2}', 'a', 'b'), 'Spark SQL';
1 2 Spark SQL

> SELECT json_tuple('{"a":1, "b":2}', 'a', 'c'), 'Spark SQL';
1 NULL Spark SQL

> SELECT json_tuple('{"a":1, "b":2}', 'a', 'c'), json_tuple('{"c":1, "d":2}', 'c', 'd'), 'Spark SQL';
Error: UNSUPPORTED_GENERATOR.MULTI_GENERATOR

Applies to: Databricks SQL Databricks Runtime 12.2 LTS and above:

SQL

> SELECT j.*, 'Spark SQL' FROM json_tuple('{"a":1, "b":2}', 'a', 'b') AS j;
1 2 Spark SQL

> SELECT j.*, 'Spark SQL' FROM json_tuple('{"a":1, "b":2}', 'a', 'c') AS j;
1 NULL Spark SQL

> SELECT j1.*, j2.*, 'Spark SQL'
FROM json_tuple('{"a":1, "b":2}', 'a', 'c') AS j1,
json_tuple('{"c":1, "d":2}', 'c', 'd') AS j2;
Related functions​

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4