prestodb/presto · error · ParsingException
backquoted identifiers are not supported; use double quotes
Error message
backquoted identifiers are not supported; use double quotes to quote identifiers
What it means
Presto does not support MySQL-style backtick-quoted identifiers. When the grammar recognizes a BACKQUOTED_IDENTIFIER token, PostProcessor.exitBackQuotedIdentifier rejects it and points the user to the Presto-idiomatic double-quote quoting syntax.
Source
Thrown at presto-parser/src/main/java/com/facebook/presto/sql/parser/SqlParser.java:218
}
@Override
public void exitUnquotedIdentifier(SqlBaseParser.UnquotedIdentifierContext context)
{
String identifier = context.IDENTIFIER().getText();
for (IdentifierSymbol identifierSymbol : EnumSet.complementOf(allowedIdentifierSymbols)) {
char symbol = identifierSymbol.getSymbol();
if (identifier.indexOf(symbol) >= 0) {
throw new ParsingException("identifiers must not contain '" + identifierSymbol.getSymbol() + "'", null, context.IDENTIFIER().getSymbol().getLine(), context.IDENTIFIER().getSymbol().getCharPositionInLine());
}
}
}
@Override
public void exitBackQuotedIdentifier(SqlBaseParser.BackQuotedIdentifierContext context)
{
Token token = context.BACKQUOTED_IDENTIFIER().getSymbol();
throw new ParsingException(
"backquoted identifiers are not supported; use double quotes to quote identifiers",
null,
token.getLine(),
token.getCharPositionInLine());
}
@Override
public void exitDigitIdentifier(SqlBaseParser.DigitIdentifierContext context)
{
Token token = context.DIGIT_IDENTIFIER().getSymbol();
throw new ParsingException(
"identifiers must not start with a digit; surround the identifier with double quotes",
null,
token.getLine(),
token.getCharPositionInLine());
}
@OverrideView on GitHub (pinned to 55bb57d202)
Solutions
- Replace all backticks with double quotes
- Reconfigure the query generator to emit ANSI double-quoted identifiers
- Pre-process SQL: convert backtick-quoted tokens to double-quoted ones before parsing
Example fix
// before String sql = "SELECT `name` FROM `users`"; // after String sql = "SELECT \"name\" FROM \"users\"";
Defensive patterns
Strategy: validation
Validate before calling
// Convert MySQL backtick quoting to Presto double quotes before parsing
String converted = sql.replaceAll("`([^`]+)`", "\\\"$1\\\"");
if (converted.contains("`")) throw new IllegalArgumentException("Unbalanced backtick in SQL"); Type guard
boolean usesBackticks(String sql) {
return sql != null && sql.indexOf('`') >= 0;
} Try / catch
try {
return sqlParser.createStatement(sql);
} catch (ParsingException e) {
if (e.getMessage() != null && e.getMessage().contains("backquoted identifiers")) {
return sqlParser.createStatement(sql.replace("`", "\"").replaceAll("\\\"([^\"]+)\\\"", "\\\"$1\\\""));
}
throw e;
} Prevention
- Configure ORMs to ANSI double-quote identifier quoting
- Run a backtick-to-double-quote normalization on imported MySQL SQL
- Search codebases for backticks in SQL string literals during migrations
- Prefer double quotes in all hand-written Presto SQL
When it happens
Trigger: Parsing SQL using backticks around identifiers, e.g. SELECT `name` FROM `users` — typical of MySQL-dialect SQL fed to Presto.
Common situations: Migrating queries from MySQL, ORMs configured for MySQL quoting, copy-pasted DDL or analytics SQL from MySQL tools.
Related errors
- identifiers must not contain '${symbol}'
- identifiers must not start with a digit; surround the identi
- INVALID_TABLE_PROPERTY
- MISSING_ATTRIBUTE
- AMBIGUOUS_ATTRIBUTE
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/a36292881008b442.
Report an issue: GitHub.