SNOW-1812881: Division broken #543
Labels
bug
Something isn't working
status-pr_pending_merge
A PR is made and is under review
status-triage_done
Initial triage done, will be further handled by the driver team
Please answer these questions before submitting your issue. Thanks!
macOS-14.7.1-arm64-arm-64bit
(but irrelevant)pip freeze
)? The relevant ones are:sqlalchemy 2.0.36
andsnowflake-sqlalchemy 1.6.1
a / b
and it does not compile correctly.This prints
a / CAST(sqrt(b) AS NUMERIC)
. However, the cast in the denominator should not happen, and this cast leads to wrong results (!).The fix is to set
div_is_floordiv = False
inSnowflakeDialect
, see e.g. this as a test:BTW: fixing
div_is_floordiv
also fixes the integer division operator, i.e.//
. Right now, this is also wrong:currently prints "a / b". Using
FixedDialect
from above, it correctly printsFLOOR(a / b)
.The text was updated successfully, but these errors were encountered: