There are a few issues with the provided Hive code:

  1. The 'ROW FORMAT DELITMITED' should be 'ROW FORMAT DELIMITED' to specify the delimiter used in the table.

  2. The 'FIELDS TERMIATED BY '\t'' should be 'FIELDS TERMINATED BY '\t'' to specify the field delimiter as a tab character.

  3. The 'STORED AS TEXTFILE' should be 'STORED AS TEXTFILE;' to properly terminate the statement.

Here is the corrected Hive code:

CREATE EXTERNAL TABLE dblab.bigdata_user(
  id INT,
  uid STRING,
  item_id STRING,
  behavior_type INT,
  item_category STRING,
  visit_date DATE,
  province STRING
)
COMMENT 'Welcome to xmu dblab!'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS TEXTFILE
LOCATION '/bigdatacase/dataset';
Hive 代码错误:创建外部表时常见问题解析

原文地址: https://www.cveoy.top/t/topic/paaM 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录