Apache Shark 0.9.1无法连接到HDFS?

时间:2014-04-22 16:50:32

标签: hadoop apache-spark shark-sql

在Shark,当我跑步时:

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';

我明白了:

[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

错误日志显示:

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

有谁知道为什么Shark没有在Hadoop中创建表格?

1 个答案:

答案 0 :(得分:1)

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

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