产品动态
产品公告
安全公告
/usr/local/service/ 路径下。[root@172 ~]# su hadoop[hadoop@172 ~]$ impala-shel.sh -i $host:27001
[$host:27001 ] > create table record(id int, name string) row format delimited fields terminated by ',' stored as textfile location 'cosn://$bucketname/';Query: create table record(id int, name string) row format delimited fields terminated by ',' stored as textfile location 'cosn://$bucketname/'Fetched 0 row(s) in 3.07s其中 $bucketname 为您的 COS 存储桶名加路径,如果使用 CHDFS 将 location 的值换成 ofs://$mountname/,$mountname 为您的 CHDFS 挂在地址加路径查看表信息,确认 location 是 cos 路径[$host:27001 ] > show create table record2;Query: show create table record2+----------------------------------------------------------------------+| result |+----------------------------------------------------------------------+| CREATE TABLE default.record2 ( || id INT, || name STRING || ) || ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' || WITH SERDEPROPERTIES ('field.delim'=',', 'serialization.format'=',') || STORED AS TEXTFILE || LOCATION 'cosn://$bucketname' || TBLPROPERTIES ('numFiles'='19', 'totalSize'='1870') |+----------------------------------------------------------------------+Fetched 1 row(s) in 5.90s
[$host:27001] > insert into record values(1,"test");Query: insert into record values(1,"test")Query submitted at: 2020-08-03 11:29:16 (Coordinator: http://$host:27004)Query progress can be monitored at: http:/$host:27004/query_plan?query_id=b246d3194efb7a8f:bc60721600000000Modified 1 row(s) in 0.64s
[$host:27001] > select * from record;Query: select * from recordQuery submitted at: 2020-08-03 11:29:31 (Coordinator: http://172.30.1.136:27004)Query progress can be monitored at: http://$host:27004/query_plan?query_id=8148da96f8c0d369:4b26432a00000000+----+---------+| id | name |+----+---------+| 1 | test |+----+---------+Fetched 1 row(s) in 0.37s
文档反馈