forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-21669][table-api] Support "table.dml-sync" option to execute s…
…tatement in sync mode This closes apache#15340
- Loading branch information
Showing
12 changed files
with
307 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
flink-table/flink-sql-client/src/test/resources/sql/insert.q
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# insert.q - insert | ||
# | ||
# 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. | ||
|
||
SET sql-client.execution.result-mode = tableau; | ||
[INFO] Session property has been set. | ||
!info | ||
|
||
SET table.dml-sync=true; | ||
[INFO] Session property has been set. | ||
!info | ||
|
||
# ========================================================================== | ||
# test streaming insert | ||
# ========================================================================== | ||
|
||
SET execution.runtime-mode = streaming; | ||
[INFO] Session property has been set. | ||
!info | ||
|
||
create table StreamingTable ( | ||
id int, | ||
str string | ||
) with ( | ||
'connector' = 'filesystem', | ||
'path' = '$VAR_STREAMING_PATH', | ||
'format' = 'csv' | ||
); | ||
[INFO] Execute statement succeed. | ||
!info | ||
|
||
INSERT INTO StreamingTable SELECT * FROM (VALUES (1, 'Hello World'), (2, 'Hi'), (2, 'Hi'), (3, 'Hello'), (3, 'World'), (4, 'ADD'), (5, 'LINE')); | ||
[INFO] Submitting SQL update statement to the cluster... | ||
[INFO] Execute statement in sync mode. Please wait for the execution finish... | ||
[INFO] Complete execution of the SQL update statement. | ||
!info | ||
|
||
SELECT * FROM StreamingTable; | ||
+----+-------------+----------------------+ | ||
| op | id | str | | ||
+----+-------------+----------------------+ | ||
| +I | 1 | Hello World | | ||
| +I | 2 | Hi | | ||
| +I | 2 | Hi | | ||
| +I | 3 | Hello | | ||
| +I | 3 | World | | ||
| +I | 4 | ADD | | ||
| +I | 5 | LINE | | ||
+----+-------------+----------------------+ | ||
Received a total of 7 rows | ||
!ok | ||
|
||
# ========================================================================== | ||
# test batch insert | ||
# ========================================================================== | ||
|
||
SET execution.runtime-mode = batch; | ||
[INFO] Session property has been set. | ||
!info | ||
|
||
create table BatchTable ( | ||
id int, | ||
str string | ||
) with ( | ||
'connector' = 'filesystem', | ||
'path' = '$VAR_BATCH_PATH', | ||
'format' = 'csv' | ||
); | ||
[INFO] Execute statement succeed. | ||
!info | ||
|
||
INSERT INTO BatchTable SELECT * FROM (VALUES (1, 'Hello World'), (2, 'Hi'), (2, 'Hi'), (3, 'Hello'), (3, 'World'), (4, 'ADD'), (5, 'LINE')); | ||
[INFO] Submitting SQL update statement to the cluster... | ||
[INFO] Execute statement in sync mode. Please wait for the execution finish... | ||
[INFO] Complete execution of the SQL update statement. | ||
!info | ||
|
||
SELECT * FROM BatchTable; | ||
+-------------+----------------------+ | ||
| id | str | | ||
+-------------+----------------------+ | ||
| 1 | Hello World | | ||
| 2 | Hi | | ||
| 2 | Hi | | ||
| 3 | Hello | | ||
| 3 | World | | ||
| 4 | ADD | | ||
| 5 | LINE | | ||
+-------------+----------------------+ | ||
Received a total of 7 rows | ||
!ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.