flume-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Макс Бартенев <max.barte...@yandex.ru>
Subject Flume Hive sink failed to serialize JSON with array
Date Thu, 23 Feb 2017 15:02:05 GMT
Hello,

I am trying to load JSON data to Hive via Hive Sink.
But it fails with the following error:

WARN org.apache.hive.hcatalog.data.JsonSerDe: Error [java.io.IOException: Field name expected]
parsing json text [{"id": "12345", "url": "https://mysite", "title": ["MyTytle"]}].
INFO org.apache.flume.sink.hive.HiveWriter: Parse failed : Unable to convert byte[] record
into Object  : {"id": "12345", "url": "https://mysite", "title": ["MyTytle"]}

Example of data:

{"id": "12345", "url": "https://mysite", "title": ["MyTytle"]}

Description of Hive table:

id      	    string              	                    
url         	string              	                    
title          array<string>       	                    
time         string              	                    

# Partitions
time         string

And the same way it works fine if JSON data doesn't contain arrays (and Hive table either).

Flume version: 1.7.0 (Cloudera CDH 5.10)

Does it possible to load JSON data with arrays via Flume Hive sink?

Thanks!

Mime
View raw message