You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
The text was updated successfully, but these errors were encountered:
Database Type
Flink Sql
Database Version
Flink 1.18
Druid Version
1.2.24
JDK Version
1.8
Error SQL
select
concat_ws(':',cast(
ip
as string)) askey
,cast(count(
ip
) as string) asval
,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(
ip
as string)) askey
,\n" +" cast(count(
ip
) as string) asval
,\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)) ASkey
, CAST(count(ip
) AS string) ASval
, CAST(600 AS int) ASexpire
FROM KAFKA_UIC_CUSTOMER_LOGIN
WHERE ip IS NOT NULL
GROUP BY hop(
timestamp
, (8), (8)),ip
;The text was updated successfully, but these errors were encountered: