Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

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

wants to merge 10 commits into from

Conversation

DLade
Copy link

@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