You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by yu...@apache.org on 2023/08/31 07:58:59 UTC
[flink] branch release-1.18 updated (5ec31f12143 -> 32743e177e0)
This is an automated email from the ASF dual-hosted git repository.
yuxia pushed a change to branch release-1.18
in repository https://gitbox.apache.org/repos/asf/flink.git
from 5ec31f12143 [FLINK-32994][runtime] Adds proper toString() implementations to the LeaderElectionDriver implementations to have human-readable versions of the driver in log messages
new ade9b5f32cd [FLINK-32982][doc] Not to suggest to swap flink-table-planner lib for using Hive dialect This closes #23324
new 32743e177e0 [hotfix][doc] Fix wrong documentation of INSERT OVERWRITE statement for Hive dialect
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../docs/connectors/table/hive/overview.md | 12 --------
.../hive-compatibility/hive-dialect/insert.md | 8 ++---
.../hive-compatibility/hive-dialect/overview.md | 2 --
.../content/docs/connectors/table/hive/overview.md | 11 -------
.../hive-compatibility/hive-dialect/insert.md | 12 ++++----
.../hive-compatibility/hive-dialect/overview.md | 3 --
.../service/operation/OperationExecutor.java | 34 +++++++---------------
7 files changed, 20 insertions(+), 62 deletions(-)
[flink] 01/02: [FLINK-32982][doc] Not to suggest to swap flink-table-planner lib for using Hive dialect This closes #23324
Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
yuxia pushed a commit to branch release-1.18
in repository https://gitbox.apache.org/repos/asf/flink.git
commit ade9b5f32cda1e76aa3c88cb4ba018c0f33b4c96
Author: luoyuxia <lu...@alumni.sjtu.edu.cn>
AuthorDate: Mon Aug 28 20:04:51 2023 +0800
[FLINK-32982][doc] Not to suggest to swap flink-table-planner lib for using Hive dialect
This closes #23324
---
.../docs/connectors/table/hive/overview.md | 12 --------
.../hive-compatibility/hive-dialect/overview.md | 2 --
.../content/docs/connectors/table/hive/overview.md | 11 -------
.../hive-compatibility/hive-dialect/overview.md | 3 --
.../service/operation/OperationExecutor.java | 34 +++++++---------------
5 files changed, 10 insertions(+), 52 deletions(-)
diff --git a/docs/content.zh/docs/connectors/table/hive/overview.md b/docs/content.zh/docs/connectors/table/hive/overview.md
index 5d791fd49f9..ea2a72056ed 100644
--- a/docs/content.zh/docs/connectors/table/hive/overview.md
+++ b/docs/content.zh/docs/connectors/table/hive/overview.md
@@ -132,18 +132,6 @@ export HADOOP_CLASSPATH=`hadoop classpath`
{{< /tab >}}
{{< /tabs >}}
-#### 移动 planner jar 包
-
-把 `FLINK_HOME/opt` 下的 jar 包 `flink-table-planner{{< scala_version >}}-{{< version >}}.jar` 移动到 `FLINK_HOME/lib` 下,并且将 `FLINK_HOME/lib` 下的 jar 包 `flink-table-planner-loader-{{< version >}}.jar` 移出去。
-具体原因请参见 [FLINK-25128](https://issues.apache.org/jira/browse/FLINK-25128)。你可以使用如下命令来完成移动 planner jar 包的工作:
-```shell
-mv $FLINK_HOME/opt/flink-table-planner{{< scala_version >}}-{{< version >}}.jar $FLINK_HOME/lib/flink-table-planner{{< scala_version >}}-{{< version >}}.jar
-mv $FLINK_HOME/lib/flink-table-planner-loader-{{< version >}}.jar $FLINK_HOME/opt/flink-table-planner-loader-{{< version >}}.jar
-```
-
-**NOTE**: 只有当要使用 [Hive 语法]({{< ref "docs/dev/table/hive-compatibility/hive-dialect/overview" >}}) 或者 [HiveServer2 endpoint]({{< ref "docs/dev/table/hive-compatibility/hiveserver2" >}}), 你才需要做上述的 jar 包移动。
-但是在集成 Hive 的时候,推荐进行上述的操作。
-
### Maven 依赖
如果您在构建自己的应用程序,则需要在 mvn 文件中添加以下依赖项。
diff --git a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/overview.md b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/overview.md
index 25cf8f4c7c0..402373b15ca 100644
--- a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/overview.md
+++ b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/overview.md
@@ -34,8 +34,6 @@ Flink 目前支持两种 SQL 方言: `default` 和 `hive`。你需要先切换
**Note:**
- 为了使用 Hive 方言, 你必须首先添加和 Hive 相关的依赖. 请参考 [Hive dependencies]({{< ref "docs/connectors/table/hive/overview" >}}#dependencies) 如何添加这些依赖。
-- 从 Flink 1.15版本开始,如果需要在 Flink SQL Client 或者 [SQL Gateway]({{< ref "docs/dev/table/sql-gateway/overview" >}}) 使用 Hive 方言的话,请首先将 `FLINK_HOME/opt` 下面的 `flink-table-planner{{< scala_version >}}-{{< version >}}.jar` jar 包放到 `FLINK_HOME/lib` 下,并将 `FLINK_HOME/lib`
- 下的 `flink-table-planner-loader-{{< version >}}.jar` jar 包移出 `FLINK_HOME/lib` 目录。否则将抛出 `ValidationException`。具体原因请参考 [FLINK-25128](https://issues.apache.org/jira/browse/FLINK-25128)。
- 请确保当前的 Catalog 是 [HiveCatalog]({{< ref "docs/connectors/table/hive/hive_catalog" >}}). 否则, 将使用 Flink 的默认方言。
在启动了 [HiveServer2 Endpoint]({{< ref "docs/dev/table/hive-compatibility/hiveserver2" >}}) 的 SQL Gateway 下,默认当前的 Catalog 就是 HiveCatalog。
- 为了实现更好的语法和语义的兼容,强烈建议首先加载 [HiveModule]({{< ref "docs/connectors/table/hive/hive_functions" >}}#use-hive-built-in-functions-via-hivemodule) 并将其放在 Module 列表的首位,以便在函数解析时优先使用 Hive 内置函数。
diff --git a/docs/content/docs/connectors/table/hive/overview.md b/docs/content/docs/connectors/table/hive/overview.md
index 249afd18f98..49c4a15eaaf 100644
--- a/docs/content/docs/connectors/table/hive/overview.md
+++ b/docs/content/docs/connectors/table/hive/overview.md
@@ -135,17 +135,6 @@ Please find the required dependencies for different Hive major versions below.
{{< /tab >}}
{{< /tabs >}}
-#### Moving the planner jar
-
-Move the jar `flink-table-planner{{< scala_version >}}-{{< version >}}.jar` located in `FLINK_HOME/opt` to `FLINK_HOME/lib` and move out the jar `flink-table-planner-loader-{{< version >}}.jar` from `FLINK_HOME/lib`.
-Please refer to [FLINK-25128](https://issues.apache.org/jira/browse/FLINK-25128) for more details. You can use the following commands to complete the work:
-```shell
-mv $FLINK_HOME/opt/flink-table-planner{{< scala_version >}}-{{< version >}}.jar $FLINK_HOME/lib/flink-table-planner{{< scala_version >}}-{{< version >}}.jar
-mv $FLINK_HOME/lib/flink-table-planner-loader-{{< version >}}.jar $FLINK_HOME/opt/flink-table-planner-loader-{{< version >}}.jar
-```
-
-**NOTE**: Such extra planner jar moving is only needed when using [Hive dialect]({{< ref "docs/dev/table/hive-compatibility/hive-dialect/overview" >}}) or [HiveServer2 endpoint]({{< ref "docs/dev/table/hive-compatibility/hiveserver2" >}}), but this is the recommended setup for Hive integration.
-
### Program maven
If you are building your own program, you need the following dependencies in your mvn file.
diff --git a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/overview.md b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/overview.md
index c2b25da920e..4fc930e1bc2 100644
--- a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/overview.md
+++ b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/overview.md
@@ -36,9 +36,6 @@ statement you execute. There's no need to restart a session to use a different d
**Note:**
- To use Hive dialect, you have to add dependencies related to Hive. Please refer to [Hive dependencies]({{< ref "docs/connectors/table/hive/overview" >}}#dependencies) for how to add the dependencies.
-- Since Flink 1.15, if you want to use Hive dialect in Flink SQL Client or [SQL Gateway]({{< ref "docs/dev/table/sql-gateway/overview" >}}), you have to put the jar `flink-table-planner{{< scala_version >}}-{{< version >}}.jar` located in `FLINK_HOME/opt`
- to `FLINK_HOME/lib` and then move out the jar `flink-table-planner-loader-{{< version >}}.jar` from `FLINK_HOME/lib`.
- Otherwise, it'll throw ValidationException. Please refer to [FLINK-25128](https://issues.apache.org/jira/browse/FLINK-25128) for more details.
- Please make sure the current catalog is [HiveCatalog]({{< ref "docs/connectors/table/hive/hive_catalog" >}}). Otherwise, it will fall back to Flink's `default` dialect.
When using SQL Gateway configured with [HiveServer2 Endpoint]({{< ref "docs/dev/table/hive-compatibility/hiveserver2" >}}), the current catalog will be a HiveCatalog by default.
- In order to have better syntax and semantic compatibility, it’s highly recommended to load [HiveModule]({{< ref "docs/connectors/table/hive/hive_functions" >}}#use-hive-built-in-functions-via-hivemodule) and
diff --git a/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java b/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java
index 2285460a4d2..96a9003f816 100644
--- a/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java
+++ b/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java
@@ -34,10 +34,8 @@ import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.CatalogNotExistException;
import org.apache.flink.table.api.DataTypes;
import org.apache.flink.table.api.EnvironmentSettings;
-import org.apache.flink.table.api.SqlDialect;
import org.apache.flink.table.api.TableConfig;
import org.apache.flink.table.api.TableException;
-import org.apache.flink.table.api.ValidationException;
import org.apache.flink.table.api.bridge.java.internal.StreamTableEnvironmentImpl;
import org.apache.flink.table.api.internal.TableEnvironmentInternal;
import org.apache.flink.table.api.internal.TableResultInternal;
@@ -92,7 +90,6 @@ import org.apache.flink.table.operations.ddl.DropOperation;
import org.apache.flink.table.resource.ResourceManager;
import org.apache.flink.table.utils.DateTimeUtils;
import org.apache.flink.util.CollectionUtil;
-import org.apache.flink.util.ExceptionUtils;
import org.apache.flink.util.FlinkException;
import org.apache.flink.util.Preconditions;
@@ -389,27 +386,16 @@ public class OperationExecutor {
catalogManager,
functionCatalog);
- try {
- return new StreamTableEnvironmentImpl(
- catalogManager,
- moduleManager,
- resourceManager,
- functionCatalog,
- tableConfig,
- env,
- planner,
- executor,
- settings.isStreamingMode());
- } catch (ValidationException e) {
- if (tableConfig.getSqlDialect() == SqlDialect.HIVE) {
- String additionErrorMsg =
- "Note: if you want to use Hive dialect, "
- + "please first move the jar `flink-table-planner_2.12` located in `FLINK_HOME/opt` "
- + "to `FLINK_HOME/lib` and then move out the jar `flink-table-planner-loader` from `FLINK_HOME/lib`.";
- ExceptionUtils.updateDetailMessage(e, t -> t.getMessage() + additionErrorMsg);
- }
- throw e;
- }
+ return new StreamTableEnvironmentImpl(
+ catalogManager,
+ moduleManager,
+ resourceManager,
+ functionCatalog,
+ tableConfig,
+ env,
+ planner,
+ executor,
+ settings.isStreamingMode());
}
private ResultFetcher executeOperationInStatementSetState(
[flink] 02/02: [hotfix][doc] Fix wrong documentation of INSERT OVERWRITE statement for Hive dialect
Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
yuxia pushed a commit to branch release-1.18
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 32743e177e008b8ce1e2098a1f7b1af06f51fc58
Author: luoyuxia <lu...@alumni.sjtu.edu.cn>
AuthorDate: Mon Aug 28 20:14:38 2023 +0800
[hotfix][doc] Fix wrong documentation of INSERT OVERWRITE statement for Hive dialect
---
.../docs/dev/table/hive-compatibility/hive-dialect/insert.md | 8 ++++----
.../docs/dev/table/hive-compatibility/hive-dialect/insert.md | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/insert.md b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/insert.md
index 938ed6002e7..4b681e628bf 100644
--- a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/insert.md
+++ b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/insert.md
@@ -33,7 +33,7 @@ can be specified by value expressions or result from query.
```sql
-- Stardard syntax
-INSERT { OVERWRITE | INTO } [TABLE] tablename
+INSERT { OVERWRITE TABLE | INTO [TABLE] } tablename
[PARTITION (partcol1[=val1], partcol2[=val2] ...) [IF NOT EXISTS]]
{ VALUES ( value [, ..] ) [, ( ... ) ] | select_statement FROM from_statement }
```
@@ -86,7 +86,7 @@ But in Flink's Hive dialect, it'll always be `nonstrict` mode which means all pa
INSERT INTO t1 VALUES ('k1', 'v1'), ('k2', 'v2');
-- insert overwrite
-INSERT OVERWRITE t1 VALUES ('k1', 'v1'), ('k2', 'v2');;
+INSERT OVERWRITE TABLE t1 VALUES ('k1', 'v1'), ('k2', 'v2');;
-- insert into table using select statement
INSERT INTO TABLE t1 SELECT * FROM t2;
@@ -175,8 +175,8 @@ In such syntax, Flink will minimize the number of data scans requires. Flink can
```sql
-- multiple insert into table
FROM from_statement
- INSERT { OVERWRITE | INTO } [TABLE] tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...) [IF NOT EXISTS]] select_statement1,
- INSERT { OVERWRITE | INTO } [TABLE] tablename2 [PARTITION ... [IF NOT EXISTS]] select_statement2
+ INSERT { OVERWRITE TABLE | INTO [TABLE] } tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...) [IF NOT EXISTS]] select_statement1,
+ INSERT { OVERWRITE TABLE | INTO [TABLE] } tablename2 [PARTITION ... [IF NOT EXISTS]] select_statement2
[, ... ]
-- multiple insert into directory
diff --git a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/insert.md b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/insert.md
index 938ed6002e7..081cc1c458a 100644
--- a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/insert.md
+++ b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/insert.md
@@ -33,16 +33,16 @@ can be specified by value expressions or result from query.
```sql
-- Stardard syntax
-INSERT { OVERWRITE | INTO } [TABLE] tablename
+INSERT { OVERWRITE TABLE | INTO [TABLE] } tablename
[PARTITION (partcol1[=val1], partcol2[=val2] ...) [IF NOT EXISTS]]
{ VALUES ( value [, ..] ) [, ( ... ) ] | select_statement FROM from_statement }
```
### Parameters
-- `OVERWRITE`
+- `OVERWRITE TABLE`
- If specify `OVERWRITE`, it will overwrite any existing data in the table or partition.
+ If specify `OVERWRITE TABLE`, it will overwrite any existing data in the table or partition.
- `PARTITION ( ... )`
@@ -86,7 +86,7 @@ But in Flink's Hive dialect, it'll always be `nonstrict` mode which means all pa
INSERT INTO t1 VALUES ('k1', 'v1'), ('k2', 'v2');
-- insert overwrite
-INSERT OVERWRITE t1 VALUES ('k1', 'v1'), ('k2', 'v2');;
+INSERT OVERWRITE TABLE t1 VALUES ('k1', 'v1'), ('k2', 'v2');;
-- insert into table using select statement
INSERT INTO TABLE t1 SELECT * FROM t2;
@@ -175,8 +175,8 @@ In such syntax, Flink will minimize the number of data scans requires. Flink can
```sql
-- multiple insert into table
FROM from_statement
- INSERT { OVERWRITE | INTO } [TABLE] tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...) [IF NOT EXISTS]] select_statement1,
- INSERT { OVERWRITE | INTO } [TABLE] tablename2 [PARTITION ... [IF NOT EXISTS]] select_statement2
+ INSERT { OVERWRITE TABLE | INTO [TABLE] } tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...) [IF NOT EXISTS]] select_statement1,
+ INSERT { OVERWRITE TABLE | INTO [TABLE] } tablename2 [PARTITION ... [IF NOT EXISTS]] select_statement2
[, ... ]
-- multiple insert into directory