Joke Collection Website - News headlines - How to obtain hive table creation statement

How to obtain hive table creation statement

hivesql sql

— Get the DDL of the specified hive table or all hive tables in the specified file. If there are partitions by day, the partition DDL of the last 7 days will be executed by default. At the same time, table supports regular expressions that conform to SQL syntax. If there are multiple tables matching, the user is prompted to choose (using file will automatically turn off this interactive function).

hivesql synctab

—Basically the same as above, but the obtained DDL will be submitted to the current hive environment, which can be used to copy the table structure in different hive environments.

If you need multi-day partition DDL, you can also use it like this (provided that the partition contains date information, such as pt=20100720):

hivesql sql s_table 20100702 — In addition to the table creation statement, Get partition DDL since 20100702

hivesql sql s_table 20100702 20100725 — ………………………..Partition DDL since 20100702-20100725

hivesql sql s_table 20100702 10 —……………………..10-day partition DDL since 20100702

hivesql synctab supports the above date limitation function like hivesql sql.

In addition, it also provides two additional functions (also very useful)

hivesql loc — Find matching hive tables or corresponding data paths based on keywords

p>

hivesql hdfswc — Get the total number of rows of all data in the specified data directory, supports ordinary text, TextFile and SequenceFile compression formats, similar to wc -l under Linux