Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Static Public Member Functions | |
static List< Column > | parse (String schemaStr) throws SchemaParseException |
Static Package Functions | |
[static initializer] | |
Static Private Member Functions | |
static Type | getTypeInfo (Schema schema, String colName) |
static boolean | isNullableType (Schema schema) |
static Schema | getColumnType (Schema schema) |
static Type | getDecimalType (Schema schema) |
static Integer | getDecimalProp (Schema schema, String propName) throws SchemaParseException |
Static Private Attributes | |
static final Map< Schema.Type, Type > | avroToImpalaPrimitiveTypeMap_ |
Utility class used to parse Avro schema. Checks that the schema is valid and performs mapping of Avro types to Impala types. Note: This code is loosely based off the parsing code in the Hive AvroSerDe.
Definition at line 44 of file AvroSchemaParser.java.
|
inlinestaticpackage |
|
inlinestaticprivate |
If a nullable type, get the schema for the non-nullable type which will provide Impala column type information.
Definition at line 129 of file AvroSchemaParser.java.
Referenced by com.cloudera.impala.util.AvroSchemaParser.getTypeInfo().
|
inlinestaticprivate |
Parses a decimal property and returns the value as an integer, or null if the property isn't set. Used to parse decimal scale/precision. Throws a SchemaParseException if the property doesn't parse to a natural number.
Definition at line 169 of file AvroSchemaParser.java.
Referenced by com.cloudera.impala.util.AvroSchemaParser.getDecimalType().
|
inlinestaticprivate |
Attempts to parse decimal type information from the Avro schema, returning a decimal ColumnType if successful or null if this schema does not map to a decimal type. Decimal is defined in Avro as a BYTE type with the logicalType property set to "decimal" and a specified scale/precision. Throws a SchemaParseException if the logicType=decimal, but scale/precision is not specified or in the incorrect format.
Definition at line 143 of file AvroSchemaParser.java.
References com.cloudera.impala.util.AvroSchemaParser.getDecimalProp().
Referenced by com.cloudera.impala.util.AvroSchemaParser.getTypeInfo().
|
inlinestaticprivate |
Parses the given Avro schema and returns the matching Impala type for this field. Handles primitive and complex types.
Definition at line 84 of file AvroSchemaParser.java.
References com.cloudera.impala.util.AvroSchemaParser.avroToImpalaPrimitiveTypeMap_, com.cloudera.impala.util.AvroSchemaParser.getColumnType(), com.cloudera.impala.util.AvroSchemaParser.getDecimalType(), and com.cloudera.impala.util.AvroSchemaParser.isNullableType().
Referenced by com.cloudera.impala.util.AvroSchemaParser.parse().
|
inlinestaticprivate |
Returns true if this is a nullable type (a Union[T, Null]), false otherwise.
Definition at line 118 of file AvroSchemaParser.java.
Referenced by com.cloudera.impala.util.AvroSchemaParser.getTypeInfo().
|
inlinestatic |
Parses the Avro schema string literal, mapping the Avro types to Impala types. Returns a list of Column objects with their name and type info set. Throws an UnsupportedOperationException if the Avro type maps to a type Impala does not yet support. Throws a SchemaParseException if the Avro schema was invalid.
Definition at line 65 of file AvroSchemaParser.java.
References com.cloudera.impala.util.AvroSchemaParser.getTypeInfo().
|
staticprivate |
Definition at line 46 of file AvroSchemaParser.java.
Referenced by com.cloudera.impala.util.AvroSchemaParser.getTypeInfo().