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.

Issue with dates in Hive

Highlighted

Issue with dates in Hive

Hello my friends,

I'm trying to push data to Hive using Nifi (PutHiveStreaming processor), but I'm having some trouble converting date types here. I have another processor working with Kafka, and they're using the same AvroSchemaRegistry, which looks like this (only the date types) :

{ "name" : "BusinessDate", "type" : [ "null", { "type" : "int", "logicalType": "date" } ] }

In Kafka, it works beautifully, but for some reason the result in Hive is this:

businessdate

17823

My BusinessDate field in Hive is of type "string". I've tried changing it to "date", but then it just saves it as null.

My AvroSchemaWriter looks like this:

Schema Write Strategy
Embed Avro Schema


Schema Access Strategy
Use 'Schema Name' Property


Schema Registry
AvroSchemaRegistry (all transactions)


Schema Name
${schema.name}


Schema Text
${avro.schema}


Compression Format
NONE

Do you have any ideas on how to fix this?

Thanks a lot!

Cheers

Don't have an account?
Coming from Hortonworks? Activate your account here