SteveStevenpoor opened a new pull request, #45:
URL: https://github.com/apache/flink-connector-hive/pull/45

   ## Description
   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:
   ```sql
   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;
   ```
   It produces
   ```
   [ERROR] Could not execute SQL statement. Reason:
   org.apache.flink.table.catalog.exceptions.TableNotPartitionedException: 
Table default.test_table in catalog myhive 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.
   
   ## Summary
   Now partitions stored in underlying HiveTable for non-hive tables. Also 
added test to verify it works as default catalog.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to