创建表语句
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.**
答案 0 :(得分:0)
创建表时,您在表名周围使用双引号,这意味着它区分大小写: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);