• kudu playground


    建表:

    CREATE TABLE my_first_table (
    id BIGINT,
    name STRING
    )
    TBLPROPERTIES(
    'storage_handler' = 'com.cloudera.kudu.hive.KuduStorageHandler',
    'kudu.table_name' = 'my_first_table',
    'kudu.master_addresses' = 'node1:7051',
    'kudu.key_columns' = 'id'
    );

    Fetched 0 row(s) in 1.26s
    [node2:21000] > show tables;
    Query: show tables
    +----------------+
    | name |
    +----------------+
    | my_first_table |
    +----------------+
    Fetched 1 row(s) in 0.06s
    [node2:21000] > desc my_first_table
    > ;
    Query: describe my_first_table
    +------+--------+---------+
    | name | type | comment |
    +------+--------+---------+
    | id | bigint | |
    | name | string | |
    +------+--------+---------+
    Fetched 2 row(s) in 5.09s

    插入数据:

    insert into my_first_table(id, name) values(1001,'shaocheng');
    insert into my_first_table(id, name) values(1002,'jianzhong');
    insert into my_first_table(id, name) values(1003,'chenbiao');
    insert into my_first_table(id, name) values(1004,'xingjiang');

    [node2:21000] > insert into my_first_table(id, name) values(1001,'shaocheng');
    Query: insert into my_first_table(id, name) values(1001,'shaocheng')
    Inserted 1 row(s) in 0.27s
    [node2:21000] > insert into my_first_table(id, name) values(1002,'jianzhong');
    Query: insert into my_first_table(id, name) values(1002,'jianzhong')
    Inserted 1 row(s) in 0.12s
    [node2:21000] > insert into my_first_table(id, name) values(1003,'chenbiao');
    Query: insert into my_first_table(id, name) values(1003,'chenbiao')
    Inserted 1 row(s) in 0.12s
    [node2:21000] > insert into my_first_table(id, name) values(1004,'xingjiang');
    Query: insert into my_first_table(id, name) values(1004,'xingjiang')
    Inserted 1 row(s) in 0.12s

    查询:

    [node2:21000] > select * from my_first_table;
    Query: select * from my_first_table
    +------+-----------+
    | id | name |
    +------+-----------+
    | 1001 | shaocheng |
    | 1002 | jianzhong |
    | 1003 | chenbiao |
    | 1004 | xingjiang |
    +------+-----------+

    删除:

    [node2:21000] > delete my_first_table where id=1003;
    Query: delete my_first_table where id=1003

    Fetched 0 row(s) in 0.17s
    [node2:21000] > select * from my_first_table;
    Query: select * from my_first_table
    +------+-----------+
    | id | name |
    +------+-----------+
    | 1001 | shaocheng |
    | 1002 | jianzhong |
    | 1004 | xingjiang |
    +------+-----------+
    Fetched 3 row(s) in 0.15s

    建立第二张表:

    CREATE TABLE my_second_table TBLPROPERTIES(
      'storage_handler' = 'com.cloudera.kudu.hive.KuduStorageHandler',
      'kudu.table_name' = 'my_second_table',
      'kudu.master_addresses' = 'node1:7051',
      'kudu.key_columns' = 'id'
    )  AS SELECT * FROM my_first_table ;

    CREATE TABLE my_second_table TBLPROPERTIES(
    'storage_handler' = 'com.cloudera.kudu.hive.KuduStorageHandler',
    'kudu.table_name' = 'my_second_table',
    'kudu.master_addresses' = 'node1:7051',
    'kudu.key_columns' = 'id'
    ) AS SELECT * FROM my_first_table ;

  • 相关阅读:
    循环取出正则匹配的内容(遍历).
    遍历datatable的方法
    asp.net获取URL和IP地址
    匹配多个字符串方法
    世界杯决赛不好看,有点像假球,被裁判黑了?
    2010南非世界杯冠军预测:荷兰夺冠!
    查了几家人民广场附近的川菜和湘菜馆
    白平衡(转载自wikipedia)
    梦想与感动
    港澳旅游相关备忘
  • 原文地址:https://www.cnblogs.com/littlesuccess/p/4867315.html
Copyright © 2020-2023  润新知