luoyuxia created FLINK-27217:
--------------------------------

             Summary: Support partition filter push down when there exists 
default_parition
                 Key: FLINK-27217
                 URL: https://issues.apache.org/jira/browse/FLINK-27217
             Project: Flink
          Issue Type: Sub-task
          Components: Connectors / Hive
            Reporter: luoyuxia
             Fix For: 1.16.0


Using Hive dialect, when the table's partition column is nullable, and when 
insert a row whose value of partition column is null,  the  row will be 
assigned to the partition with value 'HiveConf.ConfVars.DEFAULTPARTITIONNAME',  
default is  "__HIVE_DEFAULT_PARTITION__".

Like this :

 
{code:java}
create table ptestfilter (a string) partitioned by (c int);
INSERT OVERWRITE TABLE ptestfilter PARTITION (c) select 'Col1', null;
INSERT OVERWRITE TABLE ptestfilter PARTITION (c) select 'Col2', 5;
select * from ptestfilter where c between 2 and 6 ;{code}
It'll try to do partition filter push down, and  cast the 
'__HIVE_DEFAULT_PARTITION__' to int type, then it will fail with the following 
exception:
{code:java}
java.lang.NumberFormatException: For input string: "__HIVE_DEFAULT_PARTITION__"
    at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.parseInt(Integer.java:615)
    at scala.collection.immutable.StringLike$class.toInt(StringLike.scala:273)
    at scala.collection.immutable.StringOps.toInt(StringOps.scala:29)
    at 
org.apache.flink.table.planner.plan.utils.PartitionPruner$.org$apache$flink$table$planner$plan$utils$PartitionPruner$$convertPartitionFieldValue(PartitionPruner.scala:173)
 {code}
 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to