Skip to content

Commit

Permalink
Feat(mysql,doris): improve transpilation of INTERVAL (plural to singu…
Browse files Browse the repository at this point in the history
…lar) (#3543)

* Feat(bigquery,presto): improve transpilation of INTERVAL (plural to singular)

* Feat(bigquery,presto): improve transpilation of INTERVAL (plural to singular)

* Feat(bigquery,presto): improve transpilation of INTERVAL (plural to singular)
  • Loading branch information
toms authored May 24, 2024
1 parent 59de4f6 commit 078471d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/dialects/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ def concat_exprs(
return self.expression(exp.GroupConcat, this=this, separator=separator)

class Generator(generator.Generator):
INTERVAL_ALLOWS_PLURAL_FORM = False
LOCKING_READS_SUPPORTED = True
NULL_ORDERING_SUPPORTED = None
JOIN_HINTS = False
Expand Down
2 changes: 2 additions & 0 deletions tests/dialects/test_presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ def test_interval_plural_to_singular(self):
"bigquery": f"SELECT INTERVAL '1' {expected}",
"presto": f"SELECT INTERVAL '1' {expected}",
"trino": f"SELECT INTERVAL '1' {expected}",
"mysql": f"SELECT INTERVAL '1' {expected}",
"doris": f"SELECT INTERVAL '1' {expected}",
},
)

Expand Down

0 comments on commit 078471d

Please sign in to comment.