简体   繁体   中英

Apache Shark 0.9.1 can't connect to HDFS?

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?

尝试为位置指定完整的hdfs URI,如下所示:

LOCATION 'hdfs://<NAMENODE-IP>:<NAMENODE-IPC-PORT>/user/ubuntu/test'; 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM