HIVE命令

    科技2022-07-14  131

    HIVE命令:

    KV数据类型:

    map<string,string>

    建库:

    create database 库名;

    展示某个库中的表:

    show tables from 库名;

    建表:

    drop table if exists 表名;

    create (external) table (库名.)表名(

    字段  数据类型

    ...

    )

    partition by (字段  数据类型)

    row format delimited fields terminated by '分隔符'     (按照分隔符切分)

    stored as 文件类型     (按什么文件类型存储)

    ;

    导入数据:

    load data (local) inpath '数据所在目录' into table 表名 partition(字段名='字段值');

    设置hive跑local/yarn模式:

    set mapreduce.framework.name=local/yarn

    关闭hive的向量化引擎优化开关:

    set hive.vectorized.execution.enabled=false;

    Processed: 0.014, SQL: 8