Example: Retrieving the Schema of an Avro Instance of the DATASET Data Type
SELECT avroFile.getSchema() FROM myAVROTable06;
Result:
> { "type":"record", "name":"rec_0", "fields":[ { "name":"Sale", "type":{ "type":"record", "name":"rec_1", "fields":[ {"name":"Item_ID","type":"int"}, {"name":"Item_Name","type":"string"}, {"name":"Item_Color","type":"string"}, {"name":"Item_Style","type":"string"}, {"name":"Quantity_Purchased","type":"int"}, {"name":"Item_Price","type":"double"}, {"name":"Total_Price","type":"double"} ] } } ] }
Example: Retrieving the Schema of a CSV Instance of the DATASET Data Type
SELECT csvFile.getSchema() FROM myCSVTable06;
Result:
> { "field_delimiter" : "&", "record_delimiter" : "#", "field_names" : [ "Item_ID", "Item_Name", "Price" ] }