CREATE storage_format SCHEMA Examples | Teradata Vantage - Example: Schema for DATASET Type with Avro Storage Format - Teradata Vantage - Analytics Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-22
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantageā„¢
This example creates a schema for the Avro storage format of the DATASET type:
CREATE Avro SCHEMA chemDatasetSchema AS
'{
	"namespace": "example.avro",
 	"type": "record",
 	"name": "User",
 	"fields": [
     		{"name": "name", "type": "string"},
    		{"name": "favorite_number",  "type": ["int", "null"]},
     		{"name": "favorite_color", "type": ["string", "null"]}
 	 ]
	}';
This example creates the same schema using a byte literal which contains the UTF-8 encoded characters of the schema:
CREATE Avro SCHEMA chemDatasetSchema AS
'7B226E616D657370616365223A226578616D706C652E6176726F222C2274797065223A227265636F7264222C226E616D65223A2255736572222C226669656C6473223A5B7B226E616D65223A226E616D65222C2274797065223A22737472696E67227D2C7B226E616D65223A226661766F726974655F6E756D626572222C2274797065223A5B22696E74222C226E756C6C225D7D2C7B226E616D65223A226661766F726974655F636F6C6F72222C2274797065223A5B22737472696E67222C226E756C6C225D7D5D7D'xb;