This is an automated email from the ASF dual-hosted git repository.
jark pushed a commit to branch release-1.16
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.16 by this push:
new 7867dcc2f4f [FLINK-29350][hive] Add a section for moving planner jar
in Hive dependencies page
7867dcc2f4f is described below
commit 7867dcc2f4f35f23f104b1e1c29351e885cfde83
Author: yuxia Luo <[email protected]>
AuthorDate: Mon Oct 17 17:13:07 2022 +0800
[FLINK-29350][hive] Add a section for moving planner jar in Hive
dependencies page
This closes #21058
---
docs/content.zh/docs/connectors/table/hive/overview.md | 12 ++++++++++++
.../dev/table/hive-compatibility/hive-dialect/alter.md | 8 ++++----
.../dev/table/hive-compatibility/hive-dialect/create.md | 6 +++---
.../docs/dev/table/hive-compatibility/hive-dialect/drop.md | 2 +-
.../dev/table/hive-compatibility/hive-dialect/insert.md | 12 ++++++------
.../dev/table/hive-compatibility/hive-dialect/overview.md | 9 ++++-----
.../table/hive-compatibility/hive-dialect/queries/join.md | 8 ++++----
.../hive-dialect/queries/lateral-view.md | 6 +++---
.../hive-compatibility/hive-dialect/queries/sub-queries.md | 4 ++--
.../hive-compatibility/hive-dialect/queries/transform.md | 14 +++++++-------
docs/content/docs/connectors/table/hive/overview.md | 11 +++++++++++
.../dev/table/hive-compatibility/hive-dialect/alter.md | 8 ++++----
.../dev/table/hive-compatibility/hive-dialect/create.md | 4 ++--
.../docs/dev/table/hive-compatibility/hive-dialect/drop.md | 2 +-
.../dev/table/hive-compatibility/hive-dialect/insert.md | 12 ++++++------
.../dev/table/hive-compatibility/hive-dialect/overview.md | 8 +++-----
.../table/hive-compatibility/hive-dialect/queries/join.md | 8 ++++----
.../hive-dialect/queries/lateral-view.md | 4 ++--
.../hive-compatibility/hive-dialect/queries/sub-queries.md | 4 ++--
.../hive-compatibility/hive-dialect/queries/transform.md | 12 ++++++------
20 files changed, 87 insertions(+), 67 deletions(-)
diff --git a/docs/content.zh/docs/connectors/table/hive/overview.md
b/docs/content.zh/docs/connectors/table/hive/overview.md
index 96b0e604621..e9d39995736 100644
--- a/docs/content.zh/docs/connectors/table/hive/overview.md
+++ b/docs/content.zh/docs/connectors/table/hive/overview.md
@@ -268,6 +268,18 @@ 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/alter.md
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/alter.md
index 8eeaf099203..95a4ba5820e 100644
--- a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/alter.md
+++ b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/alter.md
@@ -47,7 +47,7 @@ ALTER (DATABASE|SCHEMA) database_name SET LOCATION hdfs_path;
### Synopsis
- The uses of `SCHEMA` and `DATABASE` are interchangeable - they mean the same
thing.
-- The `ALTER DATABASE .. SET LOCATION` statement doesn't move the contents of
the database's current directory to the newly specified location.
+- The `ALTER DATABASE .. SET LOCATION` statement is only supported in
Hive-2.4.0 or later. The statement doesn't move the contents of the database's
current directory to the newly specified location.
It does not change the locations associated with any tables/partitions under
the specified database.
It only changes the default parent-directory where new tables will be added
for this database.
This behaviour is analogous to how changing a table-directory does not move
existing partitions to a different location.
@@ -56,7 +56,7 @@ ALTER (DATABASE|SCHEMA) database_name SET LOCATION hdfs_path;
```sql
-- alter database's properties
-ALTER DATABASE d1 SET DBPROPERTIES ('p1' = 'v1', 'p2' = 'v2);
+ALTER DATABASE d1 SET DBPROPERTIES ('p1' = 'v1', 'p2' = 'v2');
-- alter database's localtion
ALTER DATABASE d1 SET LOCATION '/new/path';
@@ -280,10 +280,10 @@ and cascades the same change to all the partition
metadata.
```sql
-- add column
-ALTER table t1 ADD COLUMNS (ch CHAR(5), name STRING) CASCADE;
+ALTER TABLE t1 ADD COLUMNS (ch CHAR(5), name STRING) CASCADE;
-- replace column
-ALTER table t1 REPLACE COLUMNS (t1 TINYINT, d DECIMAL) CASCADE;
+ALTER TABLE t1 REPLACE COLUMNS (t1 TINYINT, d DECIMAL) CASCADE;
```
## ALTER VIEW
diff --git
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/create.md
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/create.md
index 101604e39a4..ae357260f70 100644
--- a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/create.md
+++ b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/create.md
@@ -136,10 +136,10 @@ table_constraint:
CREATE TABLE t1(key string, value string);
-- creaet partitioned table
-CREATE TABLE pt1(key string, value string) PARTITIONED by (year int, month
int);
+CREATE TABLE pt1(key string, value string) PARTITIONED BY (year int, month
int);
-- creaet table with specifc format
-CREATE TABLE t1(key string, value string) stored as ORC;
+CREATE TABLE t1(key string, value string) STORED AS ORC;
-- create table with specifc rowfromat
CREATE TABLE t1(m MAP<BIGINT, STRING>)
@@ -239,7 +239,7 @@ The function is registered to metastore and will exist in
all session unless the
CREATE FUNCTION simple_udf AS 'SimpleUdf';
-- create function using jar assuming the class `SimpleUdf` hasn't existed in
class path
-CREATE FUNCTION simple_udf AS 'SimpleUdf' USING JAR '/tmp/SimpleUdf.jar';
+CREATE FUNCTION simple_udf AS 'SimpleUdf' USING JAR '/tmp/SimpleUdf.jar';
-- create function using remote jar
CREATE FUNCTION simple_udf AS 'SimpleUdf' USING JAR
'hdfs://namenode-host:port/path/SimpleUdf.jar';
diff --git
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/drop.md
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/drop.md
index d710d0c8715..500fc21b996 100644
--- a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/drop.md
+++ b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/drop.md
@@ -112,7 +112,7 @@ Please refer to [CREATE MARCO]({{< ref
"docs/dev/table/hive-compatibility/hive-d
```sql
DROP TEMPORARY MACRO [IF EXISTS] macro_name;
```
-`DROP` returns an error if the view doesn't exist, unless `IF EXISTS` is
specified.
+`DROP` returns an error if the macro doesn't exist, unless `IF EXISTS` is
specified.
### Examples
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 6aebad09979..c4d862ef628 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
@@ -51,7 +51,7 @@ INSERT { OVERWRITE | INTO } [TABLE] tablename
- `VALUES ( value [, ..] ) [, ( ... ) ]`
- Specifies the values to be inserted explicitly. A common must be used to
separate each value in the clause.
+ Specifies the values to be inserted explicitly. A comma must be used to
separate each value in the clause.
More than one set of values can be specified to insert multiple rows.
- select_statement
@@ -96,8 +96,8 @@ INSERT INTO TABLE t1 SELECT * FROM t2;
INSERT INTO t1 PARTITION (year = 2022, month = 12) SELECT value FROM t2;
--- dynamic partition
-INSERT INTO t1 PARTITION (year = 2022, month) SELECT month, value FROM t2;
-INSERT INTO t1 PARTITION (year, month) SELECT 2022, month, value FROM t2;
+INSERT INTO t1 PARTITION (year = 2022, month) SELECT value, month FROM t2;
+INSERT INTO t1 PARTITION (year, month) SELECT value, 2022, month FROM t2;
```
## INSERT OVERWRITE DIRECTORY
@@ -106,7 +106,7 @@ INSERT INTO t1 PARTITION (year, month) SELECT 2022, month,
value FROM t2;
Query results can be inserted into filesystem directories by using a slight
variation of the syntax above:
```sql
--- Standard syntax:
+-- Standard syntax
INSERT OVERWRITE [LOCAL] DIRECTORY directory_path
[ROW FORMAT row_format] [STORED AS file_format]
{ VALUES ( value [, ..] ) [, ( ... ) ] | select_statement FROM
from_statement }
@@ -130,7 +130,7 @@ row_format:
The `LOCAL` keyword is optional. If `LOCAL` keyword is used, Flink will
write data to the directory on the local file system.
- `VALUES ( value [, ..] ) [, ( ... ) ]`
- Specifies the values to be inserted explicitly. A common must be used to
separate each value in the clause.
+ Specifies the values to be inserted explicitly. A comma must be used to
separate each value in the clause.
More than one set of values can be specified to insert multiple rows.
- select_statement
@@ -175,7 +175,7 @@ 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] tablename1 [PARTITION (partcol1=val1,
partcol2=val2 ...) [IF NOT EXISTS]] select_statement1,
INSERT { OVERWRITE | INTO } [TABLE] tablename2 [PARTITION ... [IF NOT
EXISTS]] select_statement2
[, ... ]
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 5a3176bbfa4..25cf8f4c7c0 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,12 +34,11 @@ Flink 目前支持两种 SQL 方言: `default` 和 `hive`。你需要先切换
**Note:**
- 为了使用 Hive 方言, 你必须首先添加和 Hive 相关的依赖. 请参考 [Hive dependencies]({{< ref
"docs/connectors/table/hive/overview" >}}#dependencies) 如何添加这些依赖。
-- 从 Flink 1.15版本开始,如果需要使用 Hive 方言的话,请首先将 `FLINK_HOME/opt` 下面的
`flink-table-planner_2.12` jar 包放到 `FLINK_HOME/lib` 下,并将 `FLINK_HOME/lib`
- 下的 `flink-table-planner-loader` jar 包移出 `FLINK_HOME/lib` 目录。否则将抛出
`ValidationException`。具体原因请参考
[FLINK-25128](https://issues.apache.org/jira/browse/FLINK-25128)。
+- 从 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 的 SQL Gateway,默认当前的 Catalog 就是 HiveCatalog。
-- 为了实现更好的语法和语义的兼容,强烈建议首先加载 [HiveModule]({{< ref
"docs/connectors/table/hive/hive_functions"
>}}#use-hive-built-in-functions-via-hivemodule)
- 并将其放在 Module 列表的首位,以便在函数解析时优先使用 Hive 内置函数。
+ 在启动了 [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 内置函数。
请参考文档 [here]({{< ref "docs/dev/table/modules"
>}}#how-to-load-unload-use-and-list-modules) 来将 HiveModule 放在 Module 列表的首。
在启动了 HiveServer2 endpoint 的 SQL Gateway,HiveModule 已经被加载进来了。
- Hive 方言只支持 `db.table` 这种两级的标识符,不支持带有 Catalog 名字的标识符。
diff --git
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/join.md
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/join.md
index 6c7073309dc..a605ef43f80 100644
---
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/join.md
+++
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/join.md
@@ -62,13 +62,13 @@ If there's no match in right join side, it will append
`NULL` value. `LEFT JOIN`
### RIGHT JOIN
-`RIGHT JOIN` returns all the rows from the right join side and the matched
values from the left join side. It will concat the values from both sides.
-If there's no match in left join side, it will append `NULL` value. `RIGHT
JOIN` is equivalent to `RIGHT JOIN`.
+`RIGHT JOIN` returns all the rows from the right join side and the matched
values from the left join side. It will concat the values from both sides.
+If there's no match in left join side, it will append `NULL` value. `RIGHT
JOIN` is equivalent to `RIGHT OUTER JOIN`.
### FULL JOIN
-`FULL JOIN` returns all the rows from both join sides. It will concat the
values from both sides. If there's one side does not match the row, it will
append `NULL` value.
-`FULL JOIN` is equivalent to `FULL OUTER JOIN`.
+`FULL JOIN` returns all the rows from both join sides. It will concat the
values from both sides.
+If there's one side does not match the row, it will append `NULL` value. `FULL
JOIN` is equivalent to `FULL OUTER JOIN`.
### LEFT SEMI JOIN
diff --git
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/lateral-view.md
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/lateral-view.md
index 1bcd48123b5..d80d372d051 100644
---
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/lateral-view.md
+++
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/lateral-view.md
@@ -55,7 +55,7 @@ The column alias can be omitted. In this case, aliases are
inherited from fields
Assuming you have one table:
```sql
-create table pageAds(pageid string, addid_list array<int>);
+CREATE TABLE pageAds(pageid string, addid_list array<int>);
```
And the table contains two rows:
```sql
@@ -75,8 +75,8 @@ contact_page, 5
```
Also, if you have one table:
```sql
-CREATE TABLE t1(c1 array<int>, addid_list array<int>);
-``
+CREATE TABLE t1(c1 array<int>, c2 array<int>);
+```
You can use multiple lateral view clauses to convert the column `c1` and `c2`
into separate rows:
```sql
SELECT myc1, myc2 FROM t1
diff --git
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/sub-queries.md
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/sub-queries.md
index 5a63f1b6a3b..26298cd2d4c 100644
---
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/sub-queries.md
+++
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/sub-queries.md
@@ -34,7 +34,7 @@ The sub-query can also be a query expression with `UNION`.
Hive dialect supports
### Syntax
```sql
-select_statement from ( select_statement ) [ AS ] name
+select_statement FROM ( select_statement ) [ AS ] name
```
### Example
@@ -56,7 +56,7 @@ Hive dialect also supports some types of sub-queries in the
`WHERE` clause.
### Syntax
```sql
-select_statement from table WHERE { colName { IN | NOT IN }
+select_statement FROM table WHERE { colName { IN | NOT IN }
| NOT EXISTS | EXISTS } (
subquery_select_statement )
```
diff --git
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/transform.md
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/transform.md
index b147ae7d8d9..bebf9441c72 100644
---
a/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/transform.md
+++
b/docs/content.zh/docs/dev/table/hive-compatibility/hive-dialect/queries/transform.md
@@ -94,7 +94,7 @@ inRecordWriter: RECORDWRITER record_write_class
**Note:**
- Add a script file and then transform input using the script is not
supported yet.
- - The script used must be a local script and should be accessible on all
hosts in the cluster.
+ - The script used must be a local script and should be accessible on all
hosts in the cluster.
{{< /hint >}}
- colType
@@ -116,20 +116,20 @@ For the clause `( AS colName ( colType )? [, ... ] )?`,
please be aware the foll
```sql
CREATE TABLE src(key string, value string);
-- transform using
-SELECT TRANSFORM(key, value) using 'cat' from t1;
+SELECT TRANSFORM(key, value) USING 'cat' from t1;
-- transform using with specific record writer and record reader
SELECT TRANSFORM(key, value) ROW FORMAT SERDE 'MySerDe'
WITH SERDEPROPERTIES ('p1'='v1','p2'='v2')
RECORDWRITER 'MyRecordWriter'
- using 'cat'
+ USING 'cat'
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
- RECORDREADER 'MyRecordReader' from src;
+ RECORDREADER 'MyRecordReader' FROM src;
-- use keyword MAP instead of TRANSFORM
-FROM src INSERT OVERWRITE TABLE dest1 MAP src.key, CAST(src.key / 10 AS INT)
using 'cat' as (c1, c2);
+FROM src INSERT OVERWRITE TABLE dest1 MAP src.key, CAST(src.key / 10 AS INT)
USING 'cat' AS (c1, c2);
-- specific the output of transform
-SELECT TRANSFORM(column) USING 'cat' AS c1, c2;
-SELECT TRANSFORM(column) USING 'cat' AS(c1 INT, c2 INT);
+SELECT TRANSFORM(key, value) USING 'cat' AS c1, c2;
+SELECT TRANSFORM(key, value) USING 'cat' AS (c1 INT, c2 INT);
```
diff --git a/docs/content/docs/connectors/table/hive/overview.md
b/docs/content/docs/connectors/table/hive/overview.md
index 65c67759948..651a4b13468 100644
--- a/docs/content/docs/connectors/table/hive/overview.md
+++ b/docs/content/docs/connectors/table/hive/overview.md
@@ -271,6 +271,17 @@ 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/alter.md
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/alter.md
index 8eeaf099203..95a4ba5820e 100644
--- a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/alter.md
+++ b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/alter.md
@@ -47,7 +47,7 @@ ALTER (DATABASE|SCHEMA) database_name SET LOCATION hdfs_path;
### Synopsis
- The uses of `SCHEMA` and `DATABASE` are interchangeable - they mean the same
thing.
-- The `ALTER DATABASE .. SET LOCATION` statement doesn't move the contents of
the database's current directory to the newly specified location.
+- The `ALTER DATABASE .. SET LOCATION` statement is only supported in
Hive-2.4.0 or later. The statement doesn't move the contents of the database's
current directory to the newly specified location.
It does not change the locations associated with any tables/partitions under
the specified database.
It only changes the default parent-directory where new tables will be added
for this database.
This behaviour is analogous to how changing a table-directory does not move
existing partitions to a different location.
@@ -56,7 +56,7 @@ ALTER (DATABASE|SCHEMA) database_name SET LOCATION hdfs_path;
```sql
-- alter database's properties
-ALTER DATABASE d1 SET DBPROPERTIES ('p1' = 'v1', 'p2' = 'v2);
+ALTER DATABASE d1 SET DBPROPERTIES ('p1' = 'v1', 'p2' = 'v2');
-- alter database's localtion
ALTER DATABASE d1 SET LOCATION '/new/path';
@@ -280,10 +280,10 @@ and cascades the same change to all the partition
metadata.
```sql
-- add column
-ALTER table t1 ADD COLUMNS (ch CHAR(5), name STRING) CASCADE;
+ALTER TABLE t1 ADD COLUMNS (ch CHAR(5), name STRING) CASCADE;
-- replace column
-ALTER table t1 REPLACE COLUMNS (t1 TINYINT, d DECIMAL) CASCADE;
+ALTER TABLE t1 REPLACE COLUMNS (t1 TINYINT, d DECIMAL) CASCADE;
```
## ALTER VIEW
diff --git
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/create.md
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/create.md
index 4a06257518d..356b4dd98fe 100644
--- a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/create.md
+++ b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/create.md
@@ -136,10 +136,10 @@ table_constraint:
CREATE TABLE t1(key string, value string);
-- creaet partitioned table
-CREATE TABLE pt1(key string, value string) PARTITIONED by (year int, month
int);
+CREATE TABLE pt1(key string, value string) PARTITIONED BY (year int, month
int);
-- creaet table with specifc format
-CREATE TABLE t1(key string, value string) stored as ORC;
+CREATE TABLE t1(key string, value string) STORED AS ORC;
-- create table with specifc rowfromat
CREATE TABLE t1(m MAP<BIGINT, STRING>)
diff --git
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/drop.md
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/drop.md
index d710d0c8715..500fc21b996 100644
--- a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/drop.md
+++ b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/drop.md
@@ -112,7 +112,7 @@ Please refer to [CREATE MARCO]({{< ref
"docs/dev/table/hive-compatibility/hive-d
```sql
DROP TEMPORARY MACRO [IF EXISTS] macro_name;
```
-`DROP` returns an error if the view doesn't exist, unless `IF EXISTS` is
specified.
+`DROP` returns an error if the macro doesn't exist, unless `IF EXISTS` is
specified.
### Examples
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 6aebad09979..c4d862ef628 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
@@ -51,7 +51,7 @@ INSERT { OVERWRITE | INTO } [TABLE] tablename
- `VALUES ( value [, ..] ) [, ( ... ) ]`
- Specifies the values to be inserted explicitly. A common must be used to
separate each value in the clause.
+ Specifies the values to be inserted explicitly. A comma must be used to
separate each value in the clause.
More than one set of values can be specified to insert multiple rows.
- select_statement
@@ -96,8 +96,8 @@ INSERT INTO TABLE t1 SELECT * FROM t2;
INSERT INTO t1 PARTITION (year = 2022, month = 12) SELECT value FROM t2;
--- dynamic partition
-INSERT INTO t1 PARTITION (year = 2022, month) SELECT month, value FROM t2;
-INSERT INTO t1 PARTITION (year, month) SELECT 2022, month, value FROM t2;
+INSERT INTO t1 PARTITION (year = 2022, month) SELECT value, month FROM t2;
+INSERT INTO t1 PARTITION (year, month) SELECT value, 2022, month FROM t2;
```
## INSERT OVERWRITE DIRECTORY
@@ -106,7 +106,7 @@ INSERT INTO t1 PARTITION (year, month) SELECT 2022, month,
value FROM t2;
Query results can be inserted into filesystem directories by using a slight
variation of the syntax above:
```sql
--- Standard syntax:
+-- Standard syntax
INSERT OVERWRITE [LOCAL] DIRECTORY directory_path
[ROW FORMAT row_format] [STORED AS file_format]
{ VALUES ( value [, ..] ) [, ( ... ) ] | select_statement FROM
from_statement }
@@ -130,7 +130,7 @@ row_format:
The `LOCAL` keyword is optional. If `LOCAL` keyword is used, Flink will
write data to the directory on the local file system.
- `VALUES ( value [, ..] ) [, ( ... ) ]`
- Specifies the values to be inserted explicitly. A common must be used to
separate each value in the clause.
+ Specifies the values to be inserted explicitly. A comma must be used to
separate each value in the clause.
More than one set of values can be specified to insert multiple rows.
- select_statement
@@ -175,7 +175,7 @@ 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] tablename1 [PARTITION (partcol1=val1,
partcol2=val2 ...) [IF NOT EXISTS]] select_statement1,
INSERT { OVERWRITE | INTO } [TABLE] tablename2 [PARTITION ... [IF NOT
EXISTS]] select_statement2
[, ... ]
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 89e08443cb7..c2b25da920e 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,11 +36,11 @@ 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, you have to put 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`.
+- 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, the current
catalog will be a HiveCatalog by default.
+ 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
place it first in the module list, so that Hive built-in functions can be
picked up during function resolution.
Please refer [here]({{< ref "docs/dev/table/modules"
>}}#how-to-load-unload-use-and-list-modules) for how to change resolution order.
@@ -108,5 +108,3 @@ t_env.get_config().set_sql_dialect(SqlDialect.DEFAULT)
```
{{< /tab >}}
{{< /tabs >}}
-
-
diff --git
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/join.md
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/join.md
index 6c7073309dc..a605ef43f80 100644
---
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/join.md
+++
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/join.md
@@ -62,13 +62,13 @@ If there's no match in right join side, it will append
`NULL` value. `LEFT JOIN`
### RIGHT JOIN
-`RIGHT JOIN` returns all the rows from the right join side and the matched
values from the left join side. It will concat the values from both sides.
-If there's no match in left join side, it will append `NULL` value. `RIGHT
JOIN` is equivalent to `RIGHT JOIN`.
+`RIGHT JOIN` returns all the rows from the right join side and the matched
values from the left join side. It will concat the values from both sides.
+If there's no match in left join side, it will append `NULL` value. `RIGHT
JOIN` is equivalent to `RIGHT OUTER JOIN`.
### FULL JOIN
-`FULL JOIN` returns all the rows from both join sides. It will concat the
values from both sides. If there's one side does not match the row, it will
append `NULL` value.
-`FULL JOIN` is equivalent to `FULL OUTER JOIN`.
+`FULL JOIN` returns all the rows from both join sides. It will concat the
values from both sides.
+If there's one side does not match the row, it will append `NULL` value. `FULL
JOIN` is equivalent to `FULL OUTER JOIN`.
### LEFT SEMI JOIN
diff --git
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/lateral-view.md
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/lateral-view.md
index b1463529bd0..d80d372d051 100644
---
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/lateral-view.md
+++
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/lateral-view.md
@@ -55,7 +55,7 @@ The column alias can be omitted. In this case, aliases are
inherited from fields
Assuming you have one table:
```sql
-create table pageAds(pageid string, addid_list array<int>);
+CREATE TABLE pageAds(pageid string, addid_list array<int>);
```
And the table contains two rows:
```sql
@@ -75,7 +75,7 @@ contact_page, 5
```
Also, if you have one table:
```sql
-CREATE TABLE t1(c1 array<int>, addid_list array<int>);
+CREATE TABLE t1(c1 array<int>, c2 array<int>);
```
You can use multiple lateral view clauses to convert the column `c1` and `c2`
into separate rows:
```sql
diff --git
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/sub-queries.md
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/sub-queries.md
index 5a63f1b6a3b..26298cd2d4c 100644
---
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/sub-queries.md
+++
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/sub-queries.md
@@ -34,7 +34,7 @@ The sub-query can also be a query expression with `UNION`.
Hive dialect supports
### Syntax
```sql
-select_statement from ( select_statement ) [ AS ] name
+select_statement FROM ( select_statement ) [ AS ] name
```
### Example
@@ -56,7 +56,7 @@ Hive dialect also supports some types of sub-queries in the
`WHERE` clause.
### Syntax
```sql
-select_statement from table WHERE { colName { IN | NOT IN }
+select_statement FROM table WHERE { colName { IN | NOT IN }
| NOT EXISTS | EXISTS } (
subquery_select_statement )
```
diff --git
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/transform.md
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/transform.md
index fd6af4b271f..bebf9441c72 100644
---
a/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/transform.md
+++
b/docs/content/docs/dev/table/hive-compatibility/hive-dialect/queries/transform.md
@@ -116,20 +116,20 @@ For the clause `( AS colName ( colType )? [, ... ] )?`,
please be aware the foll
```sql
CREATE TABLE src(key string, value string);
-- transform using
-SELECT TRANSFORM(key, value) using 'cat' from t1;
+SELECT TRANSFORM(key, value) USING 'cat' from t1;
-- transform using with specific record writer and record reader
SELECT TRANSFORM(key, value) ROW FORMAT SERDE 'MySerDe'
WITH SERDEPROPERTIES ('p1'='v1','p2'='v2')
RECORDWRITER 'MyRecordWriter'
- using 'cat'
+ USING 'cat'
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
- RECORDREADER 'MyRecordReader' from src;
+ RECORDREADER 'MyRecordReader' FROM src;
-- use keyword MAP instead of TRANSFORM
-FROM src INSERT OVERWRITE TABLE dest1 MAP src.key, CAST(src.key / 10 AS INT)
using 'cat' as (c1, c2);
+FROM src INSERT OVERWRITE TABLE dest1 MAP src.key, CAST(src.key / 10 AS INT)
USING 'cat' AS (c1, c2);
-- specific the output of transform
-SELECT TRANSFORM(column) USING 'cat' AS c1, c2;
-SELECT TRANSFORM(column) USING 'cat' AS(c1 INT, c2 INT);
+SELECT TRANSFORM(key, value) USING 'cat' AS c1, c2;
+SELECT TRANSFORM(key, value) USING 'cat' AS (c1 INT, c2 INT);
```