Closed Tan-JiaLiang closed 1 year ago
Hi, @Tan-JiaLiang
Hi, @itinycheng
By the way, before this bugfix, the "SELECT count(*) FROM ${table}" transform to the operator will be like this: "SELECT FROM ${table}"(source operator which transform to the clickhouse grammar) -> "count operator" -> "collect operator".
after this, transform will be like this: "SELECT '' FROM ${table}" -> "count operator" -> "collect operator".
By the way, before this bugfix, the "SELECT count(*) FROM ${table}" transform to the operator will be like this: "SELECT FROM ${table}"(source operator which transform to the clickhouse grammar) -> "count operator" -> "collect operator".
after this, transform will be like this: "SELECT '' FROM ${table}" -> "count operator" -> "collect operator".
@Tan-JiaLiang
Yes, I've learned about the issue.
In my mind, it more reasonable to add a Rule for the SQL Optimizer(VolcanoPlanner) to slove the parse error of count(*)
, if we only replace empty with ''
in connector it may cause more problems in the future, because we don't know the actual reason why selectFields is empty.
By the way, before this bugfix, the "SELECT count(*) FROM ${table}" transform to the operator will be like this: "SELECT FROM ${table}"(source operator which transform to the clickhouse grammar) -> "count operator" -> "collect operator". after this, transform will be like this: "SELECT '' FROM ${table}" -> "count operator" -> "collect operator".
@Tan-JiaLiang Yes, I've learned about the issue. In my mind, it more reasonable to add a Rule for the SQL Optimizer(VolcanoPlanner) to slove the parse error of
count(*)
, if we only replace empty with''
in connector it may cause more problems in the future, because we don't know the actual reason why selectFields is empty.
I agree with you. I had reported this bug to the flink official, and it had been fixed in 1.17.0. See FLINK-29558.
@Tan-JiaLiang Got it, thank u.
simlar to FLINK-27268, when projection not match any column, it will return 'ROW<> NOT NULL'.