Stepan Stepanishchev created FLINK-40023:
--------------------------------------------

             Summary: HiveCatalog throws TableNotPartitionedException on 
partitioned non-hive table
                 Key: FLINK-40023
                 URL: https://issues.apache.org/jira/browse/FLINK-40023
             Project: Flink
          Issue Type: Bug
          Components: Connectors / Hive
            Reporter: Stepan Stepanishchev


If we try to store the non-hive partitioned table (e.g. 
'connector'='filesystem') using HiveCatalog, then the table metadata is stored 
inside hive metastore without information about partition keys. If we will try 
to invoke operation that requires partitioned table we get 
TableNotPartitionedException.

How to reproduce:

CREATE CATALOG myhive
WITH (
'type' = 'hive',
'hive-conf-dir' = '/opt/client/Hive/config',
'hive-version' = '3.1.0'
);

USE CATALOG myhive;

create table test_table(
uuid varchar(20),
name varchar(10),
dt varchar(20)
)
PARTITIONED BY (dt)
with (
'connector' = 'filesystem',
'path' = 'hdfs://hacluster/tmp/test_table',
'format'= 'csv'
);

SHOW PARTITIONS test_table;

[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.catalog.exceptions.TableNotPartitionedException: Table 
default.test_filesystem in catalog MyCatalog is not partitioned.

 

SHOW PARTITIONS should not throw TableNotPartitionedException for a table 
created with PARTITIONED BY. If no partition instances are registered in the 
catalog, returning an empty result would be acceptable. Moreover, default 
catalog will also return an empty result for filesystem connector. So should 
HiveCatalog.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to