Exclude section field from selected queries in Hive

Suppose I have a table definition in Hive (the actual table has about 65 columns):

CREATE EXTERNAL TABLE S.TEST (
    COL1 STRING,
    COL2 STRING
)
PARTITIONED BY (extract_date STRING)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\007'
LOCATION 'xxx';

After creating the table, when I start hive -e "describe s.test", I see extract_dateone of the columns in the table. Execution select * from s.testalso returns column values extract_date. Is it possible to exclude this virtual column (?) When running select queries in Hive.

+4
source share
1 answer

Change this property

 set hive.support.quoted.identifiers=none;

and run the query as

SELECT `(extract_date)?+.+` FROM <table_name>;

I tested that it works fine.

+8
source

Source: https://habr.com/ru/post/1599398/


All Articles