I am using microsoft azure HDInsight. I have the data in the below format.
container/folder/year/month/date/file1.csv
container/folder/year/month/date/file2.csv . . .and so on.
I created an external table with partitions using below queries
'drop table partition;
CREATE EXTERNAL TABLE partition (id string, event timestamp and so on)
PARTITIONED BY (year INT, month INT, day INT)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
STORED AS TEXTFILE'
Got the output that the query submitted was successful and external table was created.
Then gave the Alter command to add the partition.
'ALTER TABLE partition ADD PARTITION(year=2014, month=1, day=1)
LOCATION'wasb://$containerName@$storageAccountName.blob.core.windows.net/containerName/folderName/2014/01/01';'
Did not get any errors even here.
Then when i gave a simple select statement, i couldn't retrieve anything from the data files.
'select * from partition where year=2014 AND month=01 AND day=01 limit 10;'
and also tried
'select * from partition limit 10;'
Both the select statement did not return anything. Unable to figure what went wrong. Any suggestions please?
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'but your filenames appear to be CSV. Are the files actually JSON encoded? - RickH