create table if not exists stu2(id int ,name string) row format delimited fields terminated by '\t' location '/user/stu2'; 1. 根据查询结果创建表 create table stu3 as select * from stu2; # 通过复制表结构和表内容创建新表 1. 根据已经存在的表结构创建表 create table stu4 like stu; 1...
SHOW TABLE EXTENDED命令可以显示Hive中表的详细信息,包括表的大小。在查询结果中,可以通过totalSize字段获取表的大小信息。 SHOWTABLEEXTENDEDLIKE'<table_name>'; 1. 1.2. 使用Hive元数据表查询 Hive元数据表中存储了关于Hive库表的元数据信息,包括表的大小。通过查询元数据表,可以获取表的大小信息。 SELECTSUM(tot...
- show tables like ‘…_order’; 显示所有分区: - show partitions; - show partitions table_name PARTITION(dt=‘2018-12-01’); - show partitions table_name PARTITION(dt=‘2018-12-01’,hour=01); 显示表的扩展信息: - show table extended; - show table extended like table_name; 显示所有表...
--6、显示表/分区的扩展信息 SHOW TABLE EXTENDED [IN|FROM database_name] LIKE table_name; show table extended like student; describe formatted itheima.student; --7、显示表的属性信息 SHOW TBLPROPERTIES table_name; show tblproperties student; --8、显示表、视图的创建语句 SHOW CREATE TABLE ([db_n...
hive>show table extended like part_table;OK Show Table Properties The first form lists all of the table properties for the table in question, one per row separated by tabs. The second form of the command prints only the value for the property that’s being asked for. ...
show partitions t_test; describe formatted t_test partition (sample_date="20190723", partition_name="7"); show table extended like 't_test' partition (sample_date="20190723",partition_name="7"); show partitions t_test PARTITION(sample_date=20190826, partition_name=9); 1.2 添加分区 代码语...
drop table if exists test_change; -- 创建普通表 drop table if exists page_view; create table page_view( viewTime int, userid bigint, page_url string, refer_url string, ip string comment 'ip address' ) comment 'this is the page view table'; ...
1. SHOW TABLES; SHOW TABLES语句用于显示当前数据库中的所有表名。该语句不需要任何参数,直接执行即可查看所有表名。 2. SHOW TABLES LIKE 'pattern'; SHOW TABLES LIKE语句用于显示符合指定模式的表名。可以使用通配符(如%和_)来匹配模式。例如,SHOW TABLES LIKE 'log%'将显示所有以log开头的表名。 3. DESCR...
显示分区:showpartitions table_testwherehr>=10andds='2010-03-03'orderbyhrdesclimit10;showtableextendedinodslike'tablename'partition(dt='20220310'); 更改文件存储格式:altertabletable_test (dt='20220308')setfileformat rcfile; 元数据 更改文件路径:altertabletable_test (dt='20220308')setlocation ""...
SHOW TABLE EXTENDED[IN|FROM database_name]LIKE table_name;show table extended like student;describe formatted itheima.student;--7、显示表的属性信息 SHOW TBLPROPERTIES table_name;show tblproperties student;--8、显示表、视图的创建语句 SHOW CREATE TABLE([db_name.]table_name|view_name);show create ...