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

keys with whitespace or punctuation #4

Open
mtoupsUNO opened this issue Apr 25, 2015 · 0 comments
Open

keys with whitespace or punctuation #4

mtoupsUNO opened this issue Apr 25, 2015 · 0 comments

Comments

@mtoupsUNO
Copy link

Hi, thanks for making this, it is saving me some trouble.

I did notice that when reading keys with whitespace, the output schema syntax is invalid.

Here's an example:

{"name": "sometext",
"stuff": {"white space":false},
"white space": "blah blah"
}

The resulting schema output will be invalid syntax due to the spaces:

CREATE TABLE x (
  name string,
  stuff struct<white space:boolean>,
  white space string)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe';

Hive does support column names with whitespace (and, in fact, any Unicode character).

The simple solution is to enclose the column names in backticks.

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

No branches or pull requests

1 participant