Skip to content

Hive SQL can not handle keys with dot or minus#12

Open
DLade wants to merge 10 commits into
cloudera:masterfrom
DLade:master
Open

Hive SQL can not handle keys with dot or minus#12
DLade wants to merge 10 commits into
cloudera:masterfrom
DLade:master

Conversation

@DLade
Copy link
Copy Markdown

@DLade DLade commented Jun 12, 2014

Because Hive SQL can not handle keys with dot or minus (e.g. dot is used as path separator at SQL) the JSON keys were patched to replace dot or minus with underline ('_').

JSON example:
{"position.x":10,"position.y":10,"id":4711}

Hive table example:
ADD JAR /tmp/hive-serdes-1.0.1-SNAPSHOT.jar;

DROP TABLE example;
CREATE TABLE example (
position_x INT,
position_y INT,
id STRING
)
ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'
LOCATION '/user/json/example/';

SELECT * from example LIMIT 10;

@DLade DLade closed this Feb 25, 2016
@DLade DLade reopened this Feb 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant