wangqinghuan commented on pull request #15151:
URL: https://github.com/apache/flink/pull/15151#issuecomment-812307978


   I want to use Flink to connect Hive external table Elasticsearch. 
   Following code doesn't create hive external table correctly after merging 
this pr into my fork. 
   ```
           EnvironmentSettings settings = 
EnvironmentSettings.newInstance().useBlinkPlanner().build();
           TableEnvironment tableEnv = TableEnvironment.create(settings);
           String name            = "myhive";
           String defaultDatabase = "default";
           String hiveConfDir     = args[0];
           HiveCatalog hive = new HiveCatalog(name, defaultDatabase, 
hiveConfDir);
           tableEnv.registerCatalog("myhive", hive);
           tableEnv.useCatalog("myhive");
   
           tableEnv.getConfig().setSqlDialect(SqlDialect.HIVE);
           tableEnv.executeSql("CREATE EXTERNAL TABLE IF NOT EXISTS test (\n" +
                   "    id      BIGINT,\n" +
                   "    name    STRING)\n" +
                   "STORED by 
'org.elasticsearch.hadoop.hive.EsStorageHandler'\n" +
                   "TBLPROPERTIES(\n" +
                   "'es.resource' = 'test',\n" +
                   "'es.nodes' = '172.16.1.192:9200'\n" +
                   ") ");
          tableEnv.executeSql("insert into test values(1,'test')");
   ```
   Executing this code, Flink create a generic hive table rather than external 
table for Elasticsearch. Do we support 
[StorageHandler](https://cwiki.apache.org/confluence/display/Hive/StorageHandlers)
 in Flink hive dialect?


-- 
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.

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


Reply via email to