Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> Parse Error with '-' in Hive


+
Alex Barrera 2012-05-31, 15:35
Copy link to this message
-
Re: Parse Error with '-' in Hive
I believe Hive column names cant have '-' in them . From what I know this JSON serde uses column names as JSON expressions. This means that if you renamed the column name you would end up with a null value for the column. You might want to try a different json serde (for e.g. the one  Amazon uses in EMR examples allows the JSON expression for a column to be passed in as a  SERDE parameter)

thanks,
Shrikanth
On May 31, 2012, at 8:35 AM, Alex Barrera wrote:

> Hi there,
>
> I'm looking for help with the following error: I keep receiving an error 'Parse Error: line 40:4 cannot recognize input near '-' 'Platform' STRING column type. '
>
> It looks to be a problem with my JSON deserializer OR Hive not recognizing the - in the field names. So far I've tried commenting it out with / and //, and tried wrapping single and double quotes around the field name. Nothing has worked so far.
>
> My code looks like this:
> add jar s3://sa/hive-json-serde-0.3.jar;
> DROP TABLE IF EXISTS viewstream;
> CREATE EXTERNAL TABLE IF NOT EXISTS viewstream(
>      cl STRING,
>      pid STRING,
>      vp STRING,
>      ar STRING,
>      UArm STRING,
>      dc STRING,
>      host STRING,
>      Blocked STRING,
>      UA-Platform STRING,
>      UA-Browser STRING,
>      UA-Version STRING,
>      UA-Language STRING
> )
>
> ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde'
>   LOCATION 'hdfs:///repo/viewstream/';
>
> Anybody run into similar errors? I can't find anything on this problem online, strangely enough.
>
> Thanks all,
> Alex
+
Alex Barrera 2012-06-01, 19:39
+
Edward Capriolo 2012-05-31, 16:00
+
alo alt 2012-05-31, 15:40
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB