[
https://issues.apache.org/jira/browse/FLINK-26259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Junwen Yi updated FLINK-26259:
------------------------------
Description:
The following test case
{code:java}
@Test
def testPartialInsertWithReorderAndHint(): Unit = {
tEnv.executeSql(
s"""
|CREATE TABLE default_database.testSink (
| `a` INT,
| `b` AS `a` + 1,
| `c` STRING,
| `d` INT,
| `e` DOUBLE
|)
|PARTITIONED BY (`c`, `d`)
|WITH (
| 'connector' = 'values',
| 'sink-insert-only' = 'true'
|)
|""".stripMargin)
registerCollection("MyTable", simpleData2, simpleType2, "x, y",
nullableOfSimpleData2)
tEnv.executeSql(
s"""
|INSERT INTO default_database.testSink /*+
OPTIONS('sink-insert-only'='false') */ (e, d, c)
|SELECT sum(y), 1, '2021' FROM MyTable GROUP BY x
|""".stripMargin).await()
val expected = List(
"null,2021,1,0.1",
"null,2021,1,0.4",
"null,2021,1,1.0",
"null,2021,1,2.2",
"null,2021,1,3.9")
val result = TestValuesTableFactory.getResults("testSink")
assertEquals(expected.sorted, result.sorted)
} {code}
Fails withÂ
> Partial insert and partition insert cannot work with sql hint
> -------------------------------------------------------------
>
> Key: FLINK-26259
> URL: https://issues.apache.org/jira/browse/FLINK-26259
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Affects Versions: 1.14.3
> Reporter: Junwen Yi
> Priority: Major
>
> The following test case
> {code:java}
> @Test
> def testPartialInsertWithReorderAndHint(): Unit = {
> tEnv.executeSql(
> s"""
> |CREATE TABLE default_database.testSink (
> | `a` INT,
> | `b` AS `a` + 1,
> | `c` STRING,
> | `d` INT,
> | `e` DOUBLE
> |)
> |PARTITIONED BY (`c`, `d`)
> |WITH (
> | 'connector' = 'values',
> | 'sink-insert-only' = 'true'
> |)
> |""".stripMargin)
> registerCollection("MyTable", simpleData2, simpleType2, "x, y",
> nullableOfSimpleData2)
> tEnv.executeSql(
> s"""
> |INSERT INTO default_database.testSink /*+
> OPTIONS('sink-insert-only'='false') */ (e, d, c)
> |SELECT sum(y), 1, '2021' FROM MyTable GROUP BY x
> |""".stripMargin).await()
> val expected = List(
> "null,2021,1,0.1",
> "null,2021,1,0.4",
> "null,2021,1,1.0",
> "null,2021,1,2.2",
> "null,2021,1,3.9")
> val result = TestValuesTableFactory.getResults("testSink")
> assertEquals(expected.sorted, result.sorted)
> } {code}
> Fails withÂ
--
This message was sent by Atlassian Jira
(v8.20.1#820001)