bowenli86 commented on a change in pull request #8694: [FLINK-12705][hive] 
Allow user to specify the Hive version in use
URL: https://github.com/apache/flink/pull/8694#discussion_r293693074
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
 ##########
 @@ -111,20 +111,24 @@
        private static final String FLINK_FUNCTION_PREFIX = "flink:";
 
        private final HiveConf hiveConf;
+       private final String hiveVersion;
 
        private HiveMetastoreClientWrapper client;
 
-       public HiveCatalog(String catalogName, @Nullable String 
defaultDatabase, @Nullable URL hiveSiteUrl) {
+       public HiveCatalog(String catalogName, @Nullable String 
defaultDatabase, @Nullable URL hiveSiteUrl, String hiveVersion) {
                this(catalogName,
                        defaultDatabase == null ? DEFAULT_DB : defaultDatabase,
-                       createHiveConf(hiveSiteUrl));
+                       createHiveConf(hiveSiteUrl),
+                       hiveVersion);
        }
 
        @VisibleForTesting
-       protected HiveCatalog(String catalogName, String defaultDatabase, 
HiveConf hiveConf) {
+       protected HiveCatalog(String catalogName, String defaultDatabase, 
HiveConf hiveConf, String hiveVersion) {
                super(catalogName, defaultDatabase == null ? DEFAULT_DB : 
defaultDatabase);
 
                this.hiveConf = hiveConf == null ? createHiveConf(null) : 
hiveConf;
+               checkArgument(!StringUtils.isNullOrWhitespaceOnly(hiveVersion), 
"hiveVersion cannot be empty");
 
 Review comment:
   ```suggestion
                checkArgument(!StringUtils.isNullOrWhitespaceOnly(hiveVersion), 
"hiveVersion cannot be null or empty");
   ```

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


With regards,
Apache Git Services

Reply via email to