In Shark, when I run:
CREATE EXTERNAL TABLE test (
memberId STRING,
category STRING,
message STRING,
source STRING,
event_type STRING,
log_level STRING,
path STRING,
host STRING,
event_timestamp STRING,
eventFields MAP<STRING,STRING>
)
PARTITIONED BY (datePart STRING)
ROW FORMAT SERDE 'com.company.eventserde.EventSerde'
LOCATION '/user/ubuntu/test';
I get:
[Hive Error]: Query returned non-zero code: 1, cause: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
Time taken (including network latency): 0.05 seconds
The error log shows:
35.526: [Full GC 112196K->28191K(1013632K), 0.1913800 secs]
FAILED: Error in metadata: MetaException(message:file:/user/ubuntu/events is not a directory or unable to create one)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
FAILED: Error in metadata: MetaException(message:file:/user/ubuntu/test is not a directory or unable to create one)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
Does anyone know why Shark isn't creating the table in Hadoop?
Try to specify the complete hdfs URI for location as follows:
LOCATION 'hdfs://<NAMENODE-IP>:<NAMENODE-IPC-PORT>/user/ubuntu/test';