使用“as select”创建配置单元表或“喜欢”并指定分隔符 [英] Create hive table using "as select" or "like" and also specify delimiter

查看:686
本文介绍了使用“as select”创建配置单元表或“喜欢”并指定分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以执行

create table< mytable> as select< query statement>



使用

 以'|'结尾的行格式定界字段; 

或做一个

创建表格< mytable>如< other_table>以'|'结尾的行格式定界字段



语言手册似乎表明不是..但有些事情让我感到痒,

解决方案


在Hive中可以创建表为select(CTAS)。


您可以尝试以下命令:

<$ p $ CREATE TABLE new_test
行格式定界
字段以'|'结尾
STORED AS RCFile
AS select * from source where col = 1




  1. 目标不能为分区表。

  2. 目标不能是外部表。

  3. 它复制结构以及数据




  4. 在Hive中也可以创建表。





    1. 它仅复制源表定义。


    Is it possible to do a

    create table <mytable> as select <query statement>

    using

    row format delimited fields terminated by '|';
    

    or to do a

    create table <mytable> like <other_table> row format delimited fields terminated by '|';

    The Language Manual seems to indicate not.. but something tickles me I had achieved this in the past.

    解决方案

    Create Table as select (CTAS) is possible in Hive.

    You can try out below command:

    CREATE TABLE new_test 
    row format delimited 
    fields terminated by '|' 
    STORED AS RCFile 
    AS select * from source where col=1
    

    1. Target cannot be partitioned table.
    2. Target cannot be external table.
    3. It copies the structure as well as the data

    Create table like is also possible in Hive.

    1. It just copies the source table definition.

    这篇关于使用“as select”创建配置单元表或“喜欢”并指定分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆