JSON_ COLUMN_ SCHEMA
On this page
This view contains information about the schema inferred for JSON columns in columnstore tables.
This schema view reads blobs from disk and fetches blobs from unlimited storage databases.
-
DATABASE_
,NAME -
TABLE_
,NAME -
COLUMN_
, and/orNAME -
SEGMENT_
ID
Column Name |
Description |
---|---|
|
The name of the related database. |
|
The name of the related table. |
|
The name of the related column. |
|
The partition’s number or placement among all the partitions. |
|
The schema inferred for the JSON column in a segment. |
|
The ID of a given segment. |
|
Refers to which page within the JSON encoding is being described. |
|
The number of rows in a given segment. |
|
Refers to which encoding is used to store the JSON column for a segment (i. |
|
The number of key paths inferred for the segment. |
schemaSize |
The size of |
Example
Below is a sample output from the json_
view.SCHEMA_
field has been formatted to make it easier to read.
CREATE DATABASE examples;USE examples;CREATE TABLE json_exp(col_a json, sort KEY());INSERT INTO json_exp VALUES('{"alpha": 1}'),('{"alpha": 1, "beta": "gamma"}');OPTIMIZE TABLE json_exp FULL;SELECT * FROM information_schema.json_column_schema WHERE database_name = 'examples'\G
*** 1. row ***
DATABASE_NAME: examples
TABLE_NAME: json_exp
COLUMN_NAME: col_a
PARTITION_ORD: 2
SCHEMA_JSON: {"JSON_DOC":{
"RepetitionType":"Required",
"data":{
"RepetitionType":"Required",
"alpha":{
"CompressedSize":12,
"DefinitionLevelEncoding":"Integer",
"DefinitionLevelSize":4,
"NumNulls":0,
"NumValues":1,
"RepetitionLevelEncoding":"Integer",
"RepetitionLevelSize":4,
"RepetitionType":"Required",
"Type":"Int64",
"UncompressedSize":12,
"ValueEncoding":"Integer"}}}}
SEGMENT_ID: 1
SEGMENT_ID: 3
PAGE_ID: 0
ROWS_COUNT: 1
ENCODING: SeekableJSON
*** 2. row ***
DATABASE_NAME: examples
TABLE_NAME: json_exp
COLUMN_NAME: col_a
PARTITION_ORD: 3
SCHEMA_JSON: {"JSON_DOC":{
"RepetitionType":"Required",
"data":{
"RepetitionType":"Required",
"alpha":{
"CompressedSize":12,
"DefinitionLevelEncoding":"Integer",
"DefinitionLevelSize":4,
"NumNulls":0,
"NumValues":1,
"RepetitionLevelEncoding":"Integer",
"RepetitionLevelSize":4,
"RepetitionType":"Required",
"Type":"Int64",
"UncompressedSize":12,
"ValueEncoding":"Integer"},
"beta":{
"CompressedSize":33,
"DefinitionLevelEncoding":"Integer",
"DefinitionLevelSize":4,
"NumNulls":0,
"NumValues":1,
"RepetitionLevelEncoding":"Integer",
"RepetitionLevelSize":4,
"RepetitionType":"Required",
"Type":"ByteArray",
"UncompressedSize":33,
"ValueEncoding":"SeekableString"}}}}
SEGMENT_ID: 1
PAGE_ID: 1
ROWS_COUNT: 1
ENCODING: SeekableJSON
Last modified: March 5, 2024