Open rpushpa opened 9 years ago
This line is wrong:
data array>,
In other words, an array of what?
It looks like your sample is actually an array containing a struct, so maybe something like:
data array<struct<country_code:string, state_set:string, ... >>,
I'll let you finish writing out the struct, but that's the idea.
Thanks. I have tried same as array having struct data type and given the DDL as shown above. Still I am failing in creating the table . More information ::My hive version is hive 0.9 version
Please provide the CREATE statement you used which is not working.
Here is the create table statement i used: CREATE external TABLE jcountry ( city string, country string, data array <struct<city_code:string, country_code:string, state_set:string, street_code:string, zip_code:string>>, state string, street string, zip string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION '/user/data1/jason/';
Hi.. Just wanted to check if you need any aditional information on resolving the issue
Are you still getting a parse error? If so, what line number? Provide the whole error message here.
Yes I get same erro telling the same for issue:
FAILED: Parse Error: line 4:2 mismatched input 'data' expecting Identifier near ',' in column specification
Thanks , Pushpa
Oh, data could be a reserved keyword. Try wrapping it in backticks, i.e.
`data` array<struct<...>>
I am trying to generate jar files using "mvn package" but it always freezes as follows. Please can you advise?
[INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for net.thornydev:json-hive-schema:jar:1.0 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 13, column 15 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] -------------------< net.thornydev:json-hive-schema >------------------- [INFO] Building json-hive-schema 1.0 [INFO] --------------------------------[ jar ]--------------------------------- Downloading from nexus: http://nexus.elsst.com/content/groups/public/org/apache/maven/plugins/maven-assembly-plugin/2.4/maven-assembly-plugin-2.4.jar Progress (1): 25/226 kB
Hi, This was so great tool for simplifing the json record into hive structure. I have created the jar files and used them to generate hive DDL . But the create table statement is failing in hive. can you pls help to resolve the issue?
sample data record: {"country":"uk","state":"ny","city":"fr","street":"nyk","zip":"1009","data":[{"country_code":"uk","state_set":"ny","city_code":"fr","street_code":"nyk","zip_code":"1009"}]}
user@ubuntu:~/lab/programs$ java -jar json-hive-schema-1.0-jar-with-dependencies.jar /home/user/Documents/json_cntry_schema.json CREATE TABLE x ( city string, country string, data array<struct<city_code:string, country_code:string, state_set:string, street_code:string, zip_code:string>>, state string, street string, zip string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe';
hive> CREATE external TABLE jcountry (
Thanks , Pushpa