Created 06-07-2017 10:35 AM
Hi,
I am able to create a table having column name with white spaces.
CREATE EXTERNAL TABLE IF NOT EXISTS EXT_MILOGS(`Country of Visits` string);
But when I try same thing with struct datatype
CREATE EXTERNAL TABLE IF NOT EXISTS EXT_MILOGS(dimensions struct<`Country of Visits`: string>);
I am not able to create the same. Am I missing something here?
Thanks,
Amol
Created 06-14-2017 06:21 AM
This is working as designed. Hive does not support literals for complex types (array, map, struct, union).
Created 06-14-2017 07:39 AM
How can I achieve this as I am getting data in JSON format and change in the column name does not read the field data with 'org.openx.data.jsonserde.JsonSerDe' parser.
Created 06-14-2017 07:59 AM
You can try loading the JSON file into hive stage table with JSON as storage type. After that you can alter the column as you wish and store it as any other complex data type. But still you cannot use string literal for complex data types rather you have an option of altering the column name as you have a stage table before with JSON storage.
Hope it helps!!