Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Avro type

Becomes Hive type

Note

null

void

boolean

boolean

int

int

long

bigint

float

float

double

double

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="aefc65ba881cd834-755391e1-45a54ba4-bc6e87f8-0dd8c861e600a20a6db3a0e4"><ac:plain-text-body><![CDATA[

bytes

Array[smallint]

Hive converts these to signed bytes.

]]></ac:plain-text-body></ac:structured-macro>

string

string

record

struct

map

map

list

array

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="443b50bf31d3c3ea-e3a1dd23-4e034c64-8852bdf5-e39f22ffa202fc0826939b01"><ac:plain-text-body><![CDATA[

union

union

Unions of [T, null] transparently convert to nullable T, other types translate directly to Hive's unions of those types. However, unions were introduced in Hive 7 and are not currently able to be used in where/group-by statements. They are essentially look-at-only. Because the AvroSerde transparently converts [T,null], to nullable T, this limitation only applies to unions of multiple types or unions not of a single type and null.

]]></ac:plain-text-body></ac:structured-macro>

enum

string

Hive has no concept of enums

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="22851f9c0836a5fc-5b84bfcb-4b0b4382-9c1a80ac-f1720e21571c06dc8796f500"><ac:plain-text-body><![CDATA[

fixed

Array[smallint]

Hive converts the bytes to signed int

]]></ac:plain-text-body></ac:structured-macro>

...

Code Block
CREATE TABLE kst
  PARTITIONED BY (ds string)
  ROW FORMAT SERDE
  'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
  WITH TBLPROPERTIES (
    'avro.schema.url'='http://schema_provider/kst.avsc')
  STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
  OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat';

...