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.

Special character in json file column name like "/pos/nr"

Special character in json file column name like "/pos/nr"

New Contributor
Hi All I am facing issue while loading data from a json file to hive. The json file contains a column name "/pos/nr". I am using jsonserde and mapped the column like ("mapping.posnr")="/pos/nr". Also in create table I am writing column name as posnr : string. The table is getting created successfully but only the column posnr is showing null. Please help me
1 REPLY 1
Highlighted

Re: Special character in json file column name like "/pos/nr"

Contributor

Ensure that you are using the following SerDe:

 

org.apache.hive.hcatalog.data.JsonSerDe

No mapping required:

 

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-RowFormats&Ser...

 

You should also consider trying to testi with the Hive built-in UDF: 'get_json_object'.

 

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-get_json_objec...

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