I'm trying to create an external table from a JSON file, which looks like this:
{"id": "0010001", "my$entities": [{"a": "foo", "b": "bar"}]}
this is a file on HDFS and I don't have control on it.
I was using rcongiu's JSON serde and wrote my statement like this:
create external table json3( id STRING,
my$entities STRING )
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
LOCATION '/my/path/to/dir/';
But then the hive shell kept complaining:
cannot recognize the input near 'ities' 'STRING' ')' in column type
I assume that it's the dollar sign "$" causing the problem. For right now I've tried using a backtick(`) and backward, forward slash to escape it but with no luck. I would like to know if there's a way to get around this without changing the original data?