julianhyde commented on code in PR #4487:
URL: https://github.com/apache/calcite/pull/4487#discussion_r2255047211
##########
core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java:
##########
@@ -619,9 +619,11 @@ public static LexicalState forConfig(SqlParser.Config
config) {
return BQID;
case BACK_TICK:
if (config.conformance().allowHyphenInUnquotedTableName()
- && config.charLiteralStyles().equals(
+ && (config.charLiteralStyles().equals(
EnumSet.of(CharLiteralStyle.BQ_SINGLE,
- CharLiteralStyle.BQ_DOUBLE))) {
+ CharLiteralStyle.BQ_DOUBLE))
+ || config.charLiteralStyles().equals(
+ EnumSet.of(CharLiteralStyle.STANDARD)))) {
Review Comment:
You should take the time to understand how it currently works. The
implementation is subtle.
Lexical states are a very clever tool (I introduced them myself, to allow
switching between quoting styles) but they are costly. Each lexical state
creates a whole new copy of the parser's transition table and therefore makes
the parser much larger.
Therefore we should only support the combinations that people actually need.
Relying on the sets of literal styles to deduce that we are dealing with
BigQuery was a hack on my part. (See
https://issues.apache.org/jira/browse/CALCITE-4247.) But that doesn't give you
license to make the hack worse. In fact, if you want to change things, you have
to figure out a way to make things better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]