zhztheplayer commented on a change in pull request #958: [CALCITE-2674]
SqlIdentifier same name with built-in function but with escape character should
be still resolved as an identifier
URL: https://github.com/apache/calcite/pull/958#discussion_r260662520
##########
File path: core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java
##########
@@ -125,6 +127,17 @@ public int getEndColumnNum() {
return endColumnNumber;
}
+ /** Mark this SqlParserPos as quoted and return itself. **/
+ public SqlParserPos setQuoted(boolean quoted) {
Review comment:
Oh, I'm sorry for missing the JIRA discussion. I'm reading -- my initial
thinking is that it sounds a little wired a "position" has opportunity to hold
a "quote".
> For immutability, can you please give an example of the bad case of
non-immutable SqlParserPos ?
I know making the `quoted` settable is not breaking current code. But maybe
a possible bad case is, someone may found it easy to change quoting of a
`SqlParserPos` programmatically to decide that whether to make an identifier a
context variable or a column, this is out of our control.
And I can see you may not want to add a parameter to constructor of
SqlParserPos. If we do such a workaround that adds "quote" to "position", maybe
like what Julian has said, making a sub-class to do that?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services