You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Flink Jira Bot (Jira)" <ji...@apache.org> on 2021/10/31 10:41:00 UTC
[jira] [Updated] (FLINK-20255) Nested decorrelate failed
[ https://issues.apache.org/jira/browse/FLINK-20255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Flink Jira Bot updated FLINK-20255:
-----------------------------------
Labels: auto-deprioritized-major stale-minor (was: auto-deprioritized-major)
I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I see this issues has been marked as Minor but is unassigned and neither itself nor its Sub-Tasks have been updated for 180 days. I have gone ahead and marked it "stale-minor". If this ticket is still Minor, please either assign yourself or give an update. Afterwards, please remove the label or in 7 days the issue will be deprioritized.
> Nested decorrelate failed
> -------------------------
>
> Key: FLINK-20255
> URL: https://issues.apache.org/jira/browse/FLINK-20255
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Affects Versions: 1.11.0, 1.12.0
> Reporter: godfrey he
> Priority: Minor
> Labels: auto-deprioritized-major, stale-minor
>
> This issue is from ML https://www.mail-archive.com/user@flink.apache.org/msg37746.html
> We can reproduce the issue through the following code
> {code:java}
> @FunctionHint(output = new DataTypeHint("ROW<val STRING>"))
> class SplitStringToRows extends TableFunction[Row] {
> def eval(str: String, separator: String = ";"): Unit = {
> if (str != null) {
> str.split(separator).foreach(s => collect(Row.of(s.trim())))
> }
> }
> }
> object Job {
> def main(args: Array[String]): Unit = {
> val settings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build()
> val streamEnv = StreamExecutionEnvironment.getExecutionEnvironment
> val streamTableEnv = StreamTableEnvironment.create(streamEnv, settings)
> streamTableEnv.createTemporarySystemFunction(
> "SplitStringToRows",
> classOf[SplitStringToRows]
> ) // Class defined in previous email
> streamTableEnv.executeSql(
> """
> CREATE TABLE table2 (
> attr1 STRING,
> attr2 STRING,
> attr3 DECIMAL,
> attr4 DATE
> ) WITH (
> 'connector' = 'datagen'
> )""")
> val q2 = streamTableEnv.sqlQuery(
> """
> SELECT
> a.attr1 AS attr1,
> attr2,
> attr3,
> attr4
> FROM table2 p, LATERAL TABLE(SplitStringToRows(p.attr1, ';')) AS a(attr1)
> """)
> streamTableEnv.createTemporaryView("view2", q2)
> val q3 =
> """
> SELECT
> w.attr1,
> p.attr3
> FROM table2 w
> LEFT JOIN LATERAL (
> SELECT
> attr1,
> attr3
> FROM (
> SELECT
> attr1,
> attr3,
> ROW_NUMBER() OVER (
> PARTITION BY attr1
> ORDER BY
> attr4 DESC NULLS LAST,
> w.attr2 = attr2 DESC NULLS LAST
> ) AS row_num
> FROM view2)
> WHERE row_num = 1) p
> ON (w.attr1 = p.attr1)
> """
> println(streamTableEnv.explainSql(q3))
> }
> }
> {code}
> The reason is {{RelDecorrelator}} in Calcite can't handle such nested decorrelate pattern now
--
This message was sent by Atlassian Jira
(v8.3.4#803005)