create table temp2 select*from temp1没有获取配置单元0.14中源表的所有属性

vecaoik1  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(370)

我正在尝试使用下面的过程从另一个表(temp1)创建表(temp2),表正在创建中,但temp2表中缺少一些属性,如下面的示例。
表temp2中缺少的属性是
field.delim'\t'--缺少序列化。format'\t'--缺少序列化

create table temp1 (
        id int,
        name string,
        age int,
        address string
        ) row format delimited fields terminated by '\t';

        describe formatted temp1;

        id int,
        name string,
        age int,
        address string

        <additional messages>
        -----
        ----

        field.delim          '\t'
        serialization.format '\t'

        create table temp2 select * from temp1 where 1=2;

        descibe formatted temp2;

        id int,
        name string,
        age int,
        address string

        <additional messages>
        -----
        ----

        field.delim          '\t'  --- This is missing
        serialization.format '\t'  --- This is missing
w3nuxt5m

w3nuxt5m1#

“create table”只需使用从“select”输入的数据来构建他的属性。我猜当配置单元将数据从一个表推送到另一个表时,没有与数据关联的格式。
您可以使用以下代码:

CREATE TABLE IF NOT EXISTS temp2 LIKE temp1;
FROM temp1 INSERT INTO temp2 SELECT * FROM temp1 WHERE 1=2;

相关问题