Hadoop – excludes partition fields from the selection query in Hive

Suppose I have the following 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'07'
LOCATION 'xxx';

Once the table is created, when I run hive -e “describe s.test”, I see that extract_date is a column in the table. Executing select * from s.test will also return extract_date column value. Is it possible to exclude this virtual (?) column when running a select query in Hive.

Change this attribute

set hive.support.quoted.identifiers=none;

and run the query

< /p>

SELECT `(extract_date)?+.+` FROM ;

I tested it to work properly.

Assumption I have the following 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'07'
LOCATION'xxx';

Once The table is created, and when I run hive -e “describe s.test”, I see that extract_date is a column in the table. Execute select * from s.test The extract_date column value will also be returned. Can this virtual (?) be excluded when running a select query in Hive? ) Column.

Change this attribute

set hive.support.quoted.identifiers= none;

and run the query

SELECT `(extract_date)?+.+` FROM ;

I test It works fine.

Leave a Comment

Your email address will not be published.