簡體   English   中英

[Amazon](500310) 無效操作:輸入末尾的語法錯誤 Position: 684;

[英][Amazon](500310) Invalid operation: syntax error at end of input Position: 684;

    CREATE EXTERNAL TABLE schema_vtvs_ai_ext.fire(
      fire_number VARCHAR(50),
      fire_year DATE,
      assessment_datetime INTEGER,
      size_class  CHAR,
      fire_location_latitude REAL,
      fire_location_longitude REAL,
      fire_origin VARCHAR(50),
      general_cause_desc VARCHAR(50),
      activity_class VARCHAR(50),
      true_cause VARCHAR(50),
      fire_start_date DATE,
      det_agent_type VARCHAR(50),
      det_agent VARCHAR(50),
      discovered_date DATE,
      reported_date DATE,
      start_for_fire_date DATE,
      fire_fighting_start_date DATE,
      initial_action_by VARCHAR(50),
      fire_type VARCHAR(50),
      fire_position_on_slope VARCHAR(50),
      weather_conditions_over_fire VARCHAR(50),
      fuel_type VARCHAR(50),
      bh_fs_date DATE,
      uc_fs_date DATE,
      ex_fs_date DATE
    );

這是我為在 Redhsift 模式中添加外部表而編寫的 SQL 代碼,但出現以下錯誤。 我似乎看不出錯誤在哪里?

    [Amazon](500310) Invalid operation: syntax error at end of input  Position: 684;

如果您的數據在 Amazon S3 中,那么您需要指定文件格式(通過 STORED AS)和 S3 中數據文件的路徑(通過 LOCATION)。

這是 csv 個文件的示例查詢(帶有 1 個行標題):

create external table <external_schema>.<table_name> (...)
row format delimited
fields terminated by ','
stored as textfile
location 's3://mybucket/myfolder/'
table properties ('numRows'='100', 'skip.header.line.count'='1');

有關詳細信息,請參閱官方文檔

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM