mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-03 03:59:12 +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)
|
||||
def _(elements, compiler, **kwargs):
|
||||
"""generic date and datetime function"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user