Repository navigation
DuckDB, MySQL, Spark, Databricks, Hive, ClickHouse: Accept string literal aliases only where each engine does - #2669
Open
LucaCappelletti94 wants to merge 1 commit into
Open
LucaCappelletti94 wants to merge 1 commit into
LucaCappelletti94 wants to merge 1 commit into
Conversation
LucaCappelletti94
added this pull request to stack #2670
October 17, 2026 19:00
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2669 +/- ##
==========================================
+ Coverage 81.29% 81.32% +0.02%
==========================================
Files 42 42
Lines 33950 33994 +44
Branches 33950 33994 +44
==========================================
+ Hits 27601 27645 +44
Misses 2785 2785
Partials 3564 3564 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
string-alias-per-engine
branch
from
October 18, 2026 10:19
6b1c131 to
82df531
Compare
…eral aliases only where each engine does
LucaCappelletti94
force-pushed
the
string-alias-per-engine
branch
from
October 18, 2026 14:41
82df531 to
560faf2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2668, which this PR is stacked on.
Engines differ on single-quoted string aliases. SQLite 3.51.1 accepts
SELECT 1 AS 'x',SELECT 1 'x',FROM t AS 'y'andFROM t 'y'. DuckDB 1.4.4 accepts only the two forms withAS. MySQL accepts a string as a column alias but not as a table alias (select_aliasagainstopt_table_aliasin https://github.com/mysql/mysql-server/blob/trunk/sql/sql_yacc.yy). Spark (namedExpressionandtableAliasin https://github.com/apache/spark/blob/master/sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4), Hive (selectItemandtableAlias) and ClickHouse (ParserAliasonly takes identifiers, https://clickhouse.com/docs/reference/syntax#identifiers) accept none of them. Every one of these dialects accepted all four forms.supports_string_literal_aliasis replaced bysupports_string_literal_column_aliasandsupports_string_literal_table_alias, each told whether the alias followsAS. Both default totrue, so dialects whose engines were not checked are unchanged. A per-engine test pins all four forms for PostgreSQL, SQLite, DuckDB, MySQL, Spark, Databricks, Hive and ClickHouse, and a capability-driven test checks every dialect against the exact errors.I used Opus in support of this PR to try and include all relevant dialects, I checked the various documentations it found and they seem correct to me.