This is an automated email from the ASF dual-hosted git repository. gaoyunhaii pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push: new 4a78754db9a [FLINK-23902][connectors/hive] Add support to Hive version 3.1.3. 4a78754db9a is described below commit 4a78754db9a06420c6001055ad0a7b44aaf0aa25 Author: yangjf2019 <highfei2...@outlook.com> AuthorDate: Tue Apr 19 12:54:04 2022 +0800 [FLINK-23902][connectors/hive] Add support to Hive version 3.1.3. This closes #19512. --- .../docs/connectors/table/hive/overview.md | 1 + .../content/docs/connectors/table/hive/overview.md | 1 + .../table/catalog/hive/client/HiveShimLoader.java | 4 ++++ .../table/catalog/hive/client/HiveShimV310.java | 2 +- .../table/catalog/hive/client/HiveShimV313.java | 22 ++++++++++++++++++++++ .../connectors/hive/HiveRunnerShimLoader.java | 1 + 6 files changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/content.zh/docs/connectors/table/hive/overview.md b/docs/content.zh/docs/connectors/table/hive/overview.md index 0acc2427ce9..b40967e8945 100644 --- a/docs/content.zh/docs/connectors/table/hive/overview.md +++ b/docs/content.zh/docs/connectors/table/hive/overview.md @@ -76,6 +76,7 @@ Flink 支持一下的 Hive 版本。 - 3.1.0 - 3.1.1 - 3.1.2 + - 3.1.3 请注意,某些功能是否可用取决于您使用的 Hive 版本,这些限制不是由 Flink 所引起的: diff --git a/docs/content/docs/connectors/table/hive/overview.md b/docs/content/docs/connectors/table/hive/overview.md index b87766cbccd..687d3afb2eb 100644 --- a/docs/content/docs/connectors/table/hive/overview.md +++ b/docs/content/docs/connectors/table/hive/overview.md @@ -76,6 +76,7 @@ Flink supports the following Hive versions. - 3.1.0 - 3.1.1 - 3.1.2 + - 3.1.3 Please note Hive itself have different features available for different versions, and these issues are not caused by Flink: diff --git a/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimLoader.java b/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimLoader.java index 53dfb34ad19..6f556be8e53 100644 --- a/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimLoader.java +++ b/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimLoader.java @@ -43,6 +43,7 @@ public class HiveShimLoader { public static final String HIVE_VERSION_V3_1_0 = "3.1.0"; public static final String HIVE_VERSION_V3_1_1 = "3.1.1"; public static final String HIVE_VERSION_V3_1_2 = "3.1.2"; + public static final String HIVE_VERSION_V3_1_3 = "3.1.3"; private static final Map<String, HiveShim> hiveShims = new ConcurrentHashMap<>(2); @@ -93,6 +94,9 @@ public class HiveShimLoader { if (v.startsWith(HIVE_VERSION_V3_1_2)) { return new HiveShimV312(); } + if (v.startsWith(HIVE_VERSION_V3_1_3)) { + return new HiveShimV313(); + } throw new CatalogException("Unsupported Hive version " + v); }); } diff --git a/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV310.java b/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV310.java index 99d7da84ba1..a04763cfa2e 100644 --- a/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV310.java +++ b/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV310.java @@ -48,7 +48,7 @@ import java.util.Optional; import java.util.Set; /** Shim for Hive version 3.1.0. */ -public class HiveShimV310 extends HiveShimV235 { +public class HiveShimV310 extends HiveShimV239 { // timestamp classes private static Class hiveTimestampClz; diff --git a/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV313.java b/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV313.java new file mode 100644 index 00000000000..0c84a838f74 --- /dev/null +++ b/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV313.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.catalog.hive.client; + +/** Shim for Hive version 3.1.3. */ +public class HiveShimV313 extends HiveShimV312 {} diff --git a/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveRunnerShimLoader.java b/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveRunnerShimLoader.java index 7dfc6f1dafd..01485d9a2d6 100644 --- a/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveRunnerShimLoader.java +++ b/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveRunnerShimLoader.java @@ -49,6 +49,7 @@ public class HiveRunnerShimLoader { case HiveShimLoader.HIVE_VERSION_V3_1_0: case HiveShimLoader.HIVE_VERSION_V3_1_1: case HiveShimLoader.HIVE_VERSION_V3_1_2: + case HiveShimLoader.HIVE_VERSION_V3_1_3: return new HiveRunnerShimV4(); default: throw new RuntimeException("Unsupported Hive version " + v);