apache / apache/parquet-java

Hive Avro to Parquet table conversion

Open
#1,415 3 comments 0 reactions 0 assignees View on GitHub
Component: Parquet Priority: Major Type: bug
Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
3d 12h
Merged PRs (30d)
33

Description

Hi.
I have following avro schema

```Java
{
"namespace" : "com.example.test",
"type" : "record",
"name" : "TestRecord",
"fields" : [{"name" : "objectLink", "type" : [
{"type": "record", "name" : "TestObj1", "fields" : [{"name":"obj1VisitorId","type":["null","string"]}] },
{"type": "record", "name" : "TestObj2", "fields" : [{"name":"obj2VisitorId","type":["null","string"]}]}
]
}],
"doc" : "event for test purposes"
}
```

Using this schema I can create avro objects, also I'm able to create table backed by avro in Hive. But then I want to create a table backed by parquet I'm doing

CREATE TABLE parquet_table
STORED AS parquet
AS SELECT \* FROM avro_table

and i get
SemanticException java.lang.UnsupportedOperationException: Unknown field type: uniontype,struct>

Is there a way to convert such structures, to store them in hive backed as parquet? This is a simple example, but I have big data structure described in avro, so I can't convert it manually, and also I have data which already stored in avro and need to be loaded in table, backed by parquet. Is there any way to this?

I'm using hive 0.13.

**Reporter**: [Dmitriy](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dimaga) / @dimaga

**Note**: *This issue was originally created as [PARQUET-155](https://issues.apache.org/jira/browse/PARQUET-155). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.