Ritesh17rb opened a new pull request, #396: URL: https://github.com/apache/datafusion-spark/pull/396
## Which issue does this PR close? Closes #234. ## Rationale for this change Spark's `timestamp_seconds` accepts numeric seconds and preserves fractional seconds as microseconds. DataFusion's `to_timestamp_seconds` loses those fractions and has different input and error behavior. ## What changes are included in this PR? - Implement and register `timestamp_seconds` with shared check-only numeric input validation. - Match Spark's checked integer scaling, exact decimal conversion, floating-point truncation and saturation, and NULL handling. - Preserve the session time zone and Spark's return nullability, with physical execution for scalar and column inputs. - Enable and expand the SQL tests and generate the function reference. ## Are these changes tested? Added SQL coverage for numeric widths, boundaries and arithmetic errors, non-finite floats, dictionaries, NULLs and time zones in both execution modes. The Spark 4.2.0 runner passes all 79 comparable records; five Arrow-specific records are skipped. Exact error messages and return nullability were also checked against live Spark. Formatting, workspace Clippy, 597 library tests, five documentation tests, all 516 SQL test runs and documentation generation pass. ## Are there any user-facing changes? Spark mode now supports `timestamp_seconds`. For example, `timestamp_seconds(1.23::DECIMAL(3,2))` returns `1970-01-01T00:00:01.230Z` in UTC. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
