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.MinorType
getDrillDataType
(String xmlType) Returns aTypeProtos.MinorType
of the corresponding XML Data Type.static TupleMetadata
getSchema
(InputStream inputStream) Returns aTupleMetadata
of the schema from an XSD file from an InputStream.static TupleMetadata
This 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
- AString
containing an XSD file.- Returns:
- A
TupleMetadata
containing a Drill representation of the XSD schema. - Throws:
IOException
- If anything goes wrong or the file is not found.
-
getSchema
Returns aTupleMetadata
of the schema from an XSD file from an InputStream.- Parameters:
inputStream
- AInputStream
containing an XSD file.- Returns:
- A
TupleMetadata
of the schema from the XSD file.
-
getDrillDataType
Returns aTypeProtos.MinorType
of the corresponding XML Data Type. Defaults to VARCHAR if unknown- Parameters:
xmlType
- A String of the XML Data Type- Returns:
- A
TypeProtos.MinorType
of the Drill data type.
-