Release Notes
Announcements
Security Announcements
/usr/local/service/ directory of the CVM instance for the EMR cluster.root, and the password is the one you set when creating the EMR cluster. Once the correct information is entered, you can enter the command line interface.[root@172 ~]# su hadoop[hadoop@172 ~]$ impala-shel.sh -i $host:27001
$host is the private IP of your Impala data node.[$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.07sHere, `$bucketname` is the name plus path of your COS bucket. If you use CHDFS, replace the `location` value with `ofs://$mountname/`, where `$mountname` is your CHDFS instance mount address plus path.View the table information and confirm that `location` is the COS path.[$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
피드백