Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

I want to Convert JsonSchema to AvroSchema & HiveDDL

Highlighted

I want to Convert JsonSchema to AvroSchema & HiveDDL

New Contributor

I want to convert JSON schema to Avro schema and hive DDL and then insert it into the table.
The schemas I have are a multi-referenced chained schemas. I wrote a processor which validates JSON agaisnt JSON schema but Im unable to find any library for the above-mentioned tasks.

Two questions.
Is converting Json schema to Avro is a good idea? because currently I've to write avro schema by hand. i want to automate it.
second. If yes, then how to do it or how should I proceed?
Any help would be appreciated.

Thanks

1 REPLY 1

Re: I want to Convert JsonSchema to AvroSchema & HiveDDL

Expert Contributor

Have a look at this if you need to by pass Avro for Hive DDL:

https://github.com/tspannhw/nifi-convertjsontoddl-processor

If you need to convert JSON to ORC (for Hive) Avro will be required. You will need to write/manage Avro schemas (recommended will be to use Schema Registry for that). Alternatively you can use Infer Avro schema to detect incoming schema from JSON but it may not be 100% correct all the time.