mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-15 02:13:44 +00:00
Fix datetime fn mysql (#9825)
* fix: mysql datetime function * empty commit to re-run tests
This commit is contained in:
parent
cdd2bc66db
commit
7d0eeeb802
@ -104,6 +104,16 @@ def _(elements, compiler, **kwargs):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@compiles(DatetimeAddFn, Dialects.MySQL)
|
||||||
|
def _(elements, compiler, **kwargs):
|
||||||
|
"""MySQL date and datetime function"""
|
||||||
|
interval = elements.clauses.clauses[0].value
|
||||||
|
interval_unit = compiler.process(elements.clauses.clauses[1], **kwargs)
|
||||||
|
return (
|
||||||
|
f"CAST(CURRENT_TIMESTAMP - interval '{interval}' {interval_unit} AS DATETIME)"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@compiles(DatetimeAddFn, Dialects.BigQuery)
|
@compiles(DatetimeAddFn, Dialects.BigQuery)
|
||||||
def _(elements, compiler, **kwargs):
|
def _(elements, compiler, **kwargs):
|
||||||
"""generic date and datetime function"""
|
"""generic date and datetime function"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user