suheng.cloud created FLINK-28403:
------------------------------------
Summary: SqlParserPos value for SqlCall is ambiguous
Key: FLINK-28403
URL: https://issues.apache.org/jira/browse/FLINK-28403
Project: Flink
Issue Type: Bug
Components: Table SQL / API
Affects Versions: 1.15.0
Reporter: suheng.cloud
Dear Community:
For a long time I was puzzled by how SqlParserPos actually means in SqlCall,
because I found the definitions for different statements in parserImpls.ftl are
not unified.
For example, in SqlCreateTable, we use `startPos.plus(getPos())` which means
if I want to find out the end position of the last token, calling
`SqlCreateTable::getParserPosition::getEndxx` is ok, but in some other
statement like SqlRichDescribeTable, we just use the intermediate `pos` as the
final position, so I must call
`SqlRichDescribeTable.getParserPosition().plusAll(SqlRichDescribeTable::getOperandList())`
to merge the result pos. Even worse in SqlStatementSet, which wrapped in
SqlExecuate, both above methods not work because no child operand covered
`END` syntax.
My question is
# Does the SqlParserPosition mean entire span for a sqlCall or not ?
# What is the easyest and right way to get the "final position" of a
SqlCall/SqlNode in fink sql?
Correct me if I miss some point, thanks for any help.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)