You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by "xiaohu.feng@hotmail.com" <xi...@hotmail.com> on 2020/12/27 12:57:34 UTC

Partition optimization problem

 I now have the following statement:
-----------------------------------------------------
tbl1 table DDL:
CREATE TABLE tbl1(
col1 string,
col2 string,
col3 string
)
PARTITIONED BY (col4 string) -- The partition filed is a date in yyyy-MM-dd format
stored as orc;
----------------------------------------------------
tbl2 table DDL:
CRETAE TABLE tbl2(
col1 string,
col2 string,
col3 string
);
----------------------------------------------------
Query statement:
> SELECT col1,col2,col3,col4 
> FROM tbl1 T1 INNER JOIN tbl2 T2
> ON   T1.col1 = T2.col2
> WHERE substr(col4,0,7) = "2020-12";
Whether the statement intercepted using UDF outside the partition field will be queried according to the partition;

Thanks!