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
I searched in the issues and found nothing similar.
Paimon UI version
main
Compute Engine
Flink
Minimal reproduce step
Currently,org.apache.paimon.web.engine.flink.common.parser.StatementParser processes input strings in a 'split line Separator' way. It can't handle the statements which contain a line separator itself.
What doesn't meet your expectations?
In my option, a more graceful way to solve this issue is that we create a Calcite Sql Parser with a FlinkSqlParser Factory.
/**
* CustomSqlParser to parse Sql list.
*/
public class CustomSqlParser {
private static final SqlParser.Config config;
private SqlParser parser;
static {
config = SqlParser.configBuilder()
.setParserFactory(FlinkSqlParserImpl.FACTORY)
.setConformance(FlinkSqlConformance.DEFAULT)
.setLex(Lex.JAVA)
.setIdentifierMaxLength(256)
.build();
}
public CustomSqlParser(String sql){
parser = SqlParser.create(sql, config);
}
public SqlParser getParser(){
return parser;
}
}
Then sqlParser can parse kinds of statements and return a sqlNodeList. The last thing we need to do is get the sqlKind of every sqlNode such as
CustomSqlParser customSqlParser = new CustomSqlParser(statementSetString);
SqlNodeList sqlNodeList = customSqlParser.getParser().parseStmtList();
for (SqlNode sqlNode : sqlNodeList) {
System.out.println(sqlNode.getKind());
}
We just use AST level of Apache Calcite that do not need to validate if the tables or columns are legal or not
Anything else?
no
Are you willing to submit a PR?
I'm willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Search before asking
Paimon UI version
main
Compute Engine
Flink
Minimal reproduce step
Currently,
org.apache.paimon.web.engine.flink.common.parser.StatementParser
processes input strings in a 'split line Separator' way. It can't handle the statements which contain a line separator itself.What doesn't meet your expectations?
In my option, a more graceful way to solve this issue is that we create a Calcite Sql Parser with a FlinkSqlParser Factory.
Then sqlParser can parse kinds of statements and return a sqlNodeList. The last thing we need to do is get the sqlKind of every sqlNode such as
We just use AST level of Apache Calcite that do not need to validate if the tables or columns are legal or not
Anything else?
no
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: