zoukankan      html  css  js  c++  java
  • 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 ;

  • 相关阅读:
    母牛的故事
    实现图的邻接矩阵和邻接表的存储
    各个位数和,找最终和为个位数
    排序5之归并排序
    排序2之冒泡与选择排序
    神奇的魔方
    关于SaveChanges
    ADO.NET Entity Framework 4.0 Self Tracking Entity
    EF4.0自跟踪实体使用小结
    ADO.NET Entity Framework 4.0 新特性
  • 原文地址:https://www.cnblogs.com/littlesuccess/p/4867315.html
Copyright © 2011-2022 走看看