I am facing issue with space in key name in the struct type while creating a table.
Following is the create table command I am using
CREATE TABLE event_test (
android_id string,
app string,
app_ver string,
at string,
birth_date int,
browser string,
carrier string,
city_name string,
closed_at string,
`country name` string,
custom struct<`test name`:string>,
os_ver string,
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
STORED AS TEXTFILE;
following is the error msg:
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.IllegalArgumentException: Error: : expected at the position 85 of 'string:string:string:string:int:string:string:string:string:string:string:struct<test name:string>' but ' ' is found.
The "country name" is working fine with “``" but if I create a struct and inside struct the “test name” if I use backtick it is throwing error. Is there a way to define the key (name with space in between ) in struct type?
Thanks in Advance
WITH SERDEPROPERTIES ( 'escapeChar'='\\\\', 'quoteChar'='\"', 'separatorChar'=',') – Glib Martynenko Jan 26 '17 at 18:45