We need to add an escape sequence for fields that don't follow the typical IDENTIFIER regex: [_A-Za-z0-9][_A-Za-z0-9]*
One thought, and currently in the #49658 PR is to use back ticks ` around special fields. I believe this is how MS SQL works, and we currently check for that syntax within the SQL plugin but mark it as unsupported:
|
@Override |
|
public void exitBackQuotedIdentifier(SqlBaseParser.BackQuotedIdentifierContext context) { |
|
Token token = context.BACKQUOTED_IDENTIFIER().getSymbol(); |
|
throw new ParsingException( |
|
"backquoted identifiers not supported; please use double quotes instead", |
|
null, |
|
token.getLine(), |
|
token.getCharPositionInLine()); |
|
} |
We should decide on an intuitive syntax that doesn't compete with single and double quotes.
We need to add an escape sequence for fields that don't follow the typical IDENTIFIER regex:
[_A-Za-z0-9][_A-Za-z0-9]*One thought, and currently in the #49658 PR is to use back ticks ` around special fields. I believe this is how MS SQL works, and we currently check for that syntax within the SQL plugin but mark it as unsupported:
elasticsearch/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/parser/SqlParser.java
Lines 161 to 169 in ec1ac0d
We should decide on an intuitive syntax that doesn't compete with single and double quotes.