0


hive、pg库,建表语句及查询表结构语句

1、hive

hive 建表语句

DROP TABLE IF EXISTS tmp_001;
CREATE TABLE tmp_001 (
 etl_time   timestamp comment '',                 
 day_id  double comment '',                   
 subs_id  string comment '',   
 msisdn  int comment ''
      )                 
comment ''
partitioned by (p_day_id string)
row format delimited 
fields terminated by '|' ;

hive 查询表结构语句

show create table tmp_001;

desc tmp_001;

2、pg库

pg库建表语句

DROP TABLE IF EXISTS fi_dwa.tmp_001;
CREATE TABLE "fi_dwa"."tmp_001" (
"etl_time"   timestamp(6),
"day_id"   numeric(8),
"subs_id"   varchar,
"msisdn"  int
)
;

pg库查询表结构语句

select column_name,data_type from information_schema.columns  where table_name = 'tmp_001';

标签: hive 大数据 hadoop

本文转载自: https://blog.csdn.net/weixin_42342968/article/details/126828805
版权归原作者 秋天の 所有, 如有侵权,请联系我们删除。

“hive、pg库,建表语句及查询表结构语句”的评论:

还没有评论