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/schema_of_json below:

schema_of_json function | Databricks Documentation

schema_of_json function

Applies to: Databricks SQL Databricks Runtime

Returns the schema of a JSON string in DDL format.

Syntax​
schema_of_json(jsonStr [, options] )
Arguments​ Returns​

A STRING holding a definition of an array of structs with n fields of strings where the column names are derived from the JSON keys. The field values hold the derived formatted SQL types. For details on options, see from_json function.

To derive the aggregated schema of a group of JSON strings use the schema_of_json_agg aggregate function.

Examples​

SQL

> SELECT schema_of_json('[{"col":0}]');
ARRAY<STRUCT<`col`: BIGINT>>

> SELECT schema_of_json('[{"col":01}]', map('allowNumericLeadingZeros', 'true'));
ARRAY<STRUCT<`col`: BIGINT>>
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