Skip to main content
Preview Spark operators in SparkSQL and Databricks compatibility modes. Both modes accept everything listed here unless a row names one mode.

Supported operators

Integer division

Integer division differs from Spark and is the difference most likely to affect a real workload, because division is common and the result is plausible rather than obviously wrong:
Returns 2, where Spark returns 2.5. Spark’s / always produces a DOUBLE or DECIMAL, so any migrated query that divides two integers returns different numbers here, with no diagnostic. Cast one operand to make the intent explicit:

Other differences

  • Arithmetic overflow, division by zero, and an invalid cast raise an error, as in Spark’s default ANSI mode. try_cast returns NULL instead.
  • A string is converted implicitly where a number is expected, as in Spark: '2' * 3 returns 6, and a string that is not a number raises an error.