Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SQLUtils.parseStatements解析Flink SQL 滑动窗口计算SQL丢失部分语句 #6246

Open
hyfaidamimi opened this issue Nov 22, 2024 · 0 comments

Comments

@hyfaidamimi
Copy link

Database Type

Flink Sql

Database Version

Flink 1.18

Druid Version

1.2.24

JDK Version

1.8

Error SQL

select
concat_ws(':',cast(ipas string)) as key,
cast(count(ip) as string) as val,
cast(600 as int) as expire
rom KAFKA_USER
where ip is not null
group by hop(timestamp, interval '60' seconds(8), interval '600' seconds(8)),ip

Testcase Code

public static void main(String[] args) {
String sql = "select\n" +
" concat_ws(':',cast(ipas string)) as key,\n" +
" cast(count(ip) as string) as val,\n" +
" cast(600 as int) as expire\n" +
"from KAFKA_UIC_CUSTOMER_LOGIN\n" +
" where ip is not null\n" +
"group by hop(timestamp, interval '60' seconds(8), interval '600' seconds(8)),ip;";
SQLSelectStatement sqlStatement = getSqlStatement(1L, sql, true);
SQLUtils.FormatOption formatOption = new SQLUtils.FormatOption(true, true);
String sqlString = SQLUtils.toSQLString(sqlStatement, DbType.blink, formatOption);
System.out.println(sqlString);
}

Stacktrace Info

No response

Error Info

输出结果:
SELECT concat_ws(':', CAST(ip AS string)) AS key, CAST(count(ip) AS string) AS val, CAST(600 AS int) AS expire
FROM KAFKA_UIC_CUSTOMER_LOGIN
WHERE ip IS NOT NULL
GROUP BY hop(timestamp, (8), (8)), ip;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant