Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ANSI NaN and infinity use the wrong exception for cast to timestamp

Open Beginner friendly
#7,001 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
scala
Domain
data

Research direction

The issue names the error class InvalidInputInCastToDatetime, which already maps to Spark's SparkDateTimeException. Start by finding where the NaN and infinity cast-to-timestamp path under ANSI mode picks SparkNumberFormatException instead, and reuse the existing mapping. The payload names no files, so search for InvalidInputInCastToDatetime and for ANSI cast tests. Done when a NaN or infinite double cast to TIMESTAMP under ANSI throws SparkDateTimeException with Spark's message format.

Written by the indexing model from the issue text.

Description

requires-triage

With ANSI on, NaN and infinities raise SparkNumberFormatException (CastInvalidValue) with text like The value 'inf' of the type "STRING". Spark throws SparkDateTimeException: The value Infinity of the type "DOUBLE" cannot be cast to "TIMESTAMP". The error class and SQLSTATE match. InvalidInputInCastToDatetime already maps to Spark's exception. The source type, the spelling (inf versus Infinity), and the quoting differ.

This predates and is unchanged by #6969; found in review there.

Dominant language
Scala
Stars
1.3k
Forks
391
Avg merge
2d 10h
Merged PRs (30d)
421

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/datafusion-comet

All issues in apache/datafusion-comet

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.