Fixes #5742 where profiler modulo has unescaped character (#5743)

* Fixed athena modulo function

* fixed modulo function for MySQL and escaped perc char in base modulo function

* Removed compilation logic for MSSQL

* fixed python formating

* Added modulo and random logic for oracle

* Fixed py format
This commit is contained in:
Teddy 2022-06-29 14:38:44 +02:00 committed by GitHub
parent 38b04b76a9
commit 2f29c5fe93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -57,6 +57,9 @@ def _(element, compiler, **kw):
@compiles(ModuloFn, Dialects.Redshift)
@compiles(ModuloFn, Dialects.Snowflake)
@compiles(ModuloFn, Dialects.Postgres)
@compiles(ModuloFn, Dialects.Athena)
@compiles(ModuloFn, Dialects.MySQL)
@compiles(ModuloFn, Dialects.Oracle)
def _(element, compiler, **kw):
value, base = validate_and_compile(element, compiler, **kw)

View File

@ -83,3 +83,9 @@ def _(*_, **__):
def _(*_, **__):
"""Postgres random logic"""
return "ABS((RANDOM() * 100)::INTEGER)"
@compiles(RandomNumFn, Dialects.Oracle)
def _(*_, **__):
"""Oracle random logic"""
return "ABS(DBMS_RANDOM.VALUE) * 100"