【问题标题】:when i try to upload into snowflake , using put command and table stage getting error当我尝试上传到雪花时,使用 put 命令和 table 阶段出现错误
【发布时间】:2020-05-14 16:37:58
【问题描述】:

创建表语句

create table  "DEMO_DB"."PUBLIC"."Trips"
(tripduration integer,
  starttime timestamp,
  stoptime timestamp,
  start_station_id integer,
  start_station_name string,
  start_station_latitude float,
  start_station_longitude float,
  end_station_id integer,
  end_station_name string,
  end_station_latitude float,
  end_station_longitude float,
  bikeid integer,
  usertype string,
  birth_year integer,
  gender integer);

PUT 命令

avinash#COMPUTE_WH@DEMO_DB.PUBLIC>put file://C:\Users\lanreddy\Desktop\JC-202002-citibike-tripdata1.csv @%Trips;
 **002003 (02000): SQL compilation error: Stage 'DEMO_DB.PUBLIC."%TRIPS"' does not exist or not authorized.**

【问题讨论】:

    标签: snowflake-cloud-data-platform


    【解决方案1】:

    当您创建表时,您在表名周围使用了双引号,这意味着它区分大小写:create table "DEMO_DB"."PUBLIC"."Trips"。当您这样做时,意味着您现在每次引用该表时都需要将其放在引号中(表名是 Trips 而不是 TRIPS 或 trips)

    尝试将此作为您的 PUT 命令运行:

    COMPUTE_WH@DEMO_DB.PUBLIC> put file://C:\Users\lanreddy\Desktop\JC-202002-citibike-tripdata1.csv @%"Trips";
    

    或者这个:

    COMPUTE_WH@DEMO_DB.PUBLIC> put file://C:\Users\lanreddy\Desktop\JC-202002-citibike-tripdata1.csv @"%Trips";
    

    我建议永远不要使用双引号创建表格。如果您将原来的 CREATE TABLE 语句更改为以下语句,那么您原来的 PUT 命令可能会起作用:

    create table  DEMO_DB.PUBLIC.trips
    (tripduration integer,
      starttime timestamp,
      stoptime timestamp,
      start_station_id integer,
      start_station_name string,
      start_station_latitude float,
      start_station_longitude float,
      end_station_id integer,
      end_station_name string,
      end_station_latitude float,
      end_station_longitude float,
      bikeid integer,
      usertype string,
      birth_year integer,
      gender integer);
    

    【讨论】:

      猜你喜欢
      • 2021-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多