Class DrillXSDSchemaUtils
java.lang.Object
org.apache.drill.exec.store.xml.xsd.DrillXSDSchemaUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.common.collect.ImmutableMap<String, TypeProtos.MinorType> This map maps the data types defined by the XSD definition to Drill data types. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeProtos.MinorTypegetDrillDataType(String xmlType) Returns aTypeProtos.MinorTypeof the corresponding XML Data Type.static TupleMetadatagetSchema(InputStream inputStream) Returns aTupleMetadataof the schema from an XSD file from an InputStream.static TupleMetadataThis function is only used for testing, but accepts a XSD file as input rather than aInputStream
-
Field Details
-
XML_TYPE_MAPPINGS
public static final com.google.common.collect.ImmutableMap<String,TypeProtos.MinorType> XML_TYPE_MAPPINGSThis map maps the data types defined by the XSD definition to Drill data types.
-
-
Constructor Details
-
DrillXSDSchemaUtils
public DrillXSDSchemaUtils()
-
-
Method Details
-
getSchema
This function is only used for testing, but accepts a XSD file as input rather than aInputStream- Parameters:
filename- AStringcontaining an XSD file.- Returns:
- A
TupleMetadatacontaining a Drill representation of the XSD schema. - Throws:
IOException- If anything goes wrong or the file is not found.
-
getSchema
Returns aTupleMetadataof the schema from an XSD file from an InputStream.- Parameters:
inputStream- AInputStreamcontaining an XSD file.- Returns:
- A
TupleMetadataof the schema from the XSD file.
-
getDrillDataType
Returns aTypeProtos.MinorTypeof the corresponding XML Data Type. Defaults to VARCHAR if unknown- Parameters:
xmlType- A String of the XML Data Type- Returns:
- A
TypeProtos.MinorTypeof the Drill data type.
-