You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Gengliang Wang (Jira)" <ji...@apache.org> on 2025/09/17 23:08:00 UTC
[jira] [Assigned] (SPARK-52659) Misleading modulo error message in ANSI mode
[ https://issues.apache.org/jira/browse/SPARK-52659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gengliang Wang reassigned SPARK-52659:
--------------------------------------
Assignee: Rishab Joshi
> Misleading modulo error message in ANSI mode
> --------------------------------------------
>
> Key: SPARK-52659
> URL: https://issues.apache.org/jira/browse/SPARK-52659
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 4.0.0
> Reporter: Rishab Joshi
> Assignee: Rishab Joshi
> Priority: Minor
> Labels: pull-request-available
> Attachments: Screenshot 2025-07-02 at 11.48.27 AM.png
>
>
> Spark throws misleading exception message for modulo operation division-by-zero in ANSI mode.
> Here is the snapshot of the spark-shell 4.0. It suggests - "Use `try_divide`" , however it should have said to - "Use `try_mod`.
> !Screenshot 2025-07-02 at 11.48.27 AM.png|width=1416,height=345!
>
> The spark [ANSI doc |https://spark.apache.org/docs/latest/sql-ref-ansi-compliance.html]also says to use `try_mod` to tolerate this division-by-zero. Here is the text from the document:
> {code:java}
> try_mod: identical to the remainder operator %, except that it returns NULL result instead of throwing an exception on dividing 0.{code}
>
> This ticket is about maintaining consistency with the document and replacing `try_divide` with `try_mod` in the error message.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org