dragonknightk opened a new pull request, #422: URL: https://github.com/apache/datafusion-spark/pull/422
## Which issue does this PR close? - Closes #96. ## Rationale for this change `quote` of a timestamp wrote ISO 8601 with a `T`, such as `'2024-01-15T12:30:45'`. Spark writes a space between date and time, and drops trailing zeros of the fraction, because its analyzer casts the argument to STRING with Spark's CAST. ## What changes are included in this PR? `quote` now keeps a timestamp argument out of DataFusion's string coercion and casts it with `spark_cast`. A TIMESTAMP is written in the session time zone. Other argument types are cast to a string as before. Other functions that coerce a timestamp to a string still use Arrow's format, and are left for separate changes. ## Are these changes tested? Yes, `string/quote.slt` covers fraction and no fraction, trailing zeros, before 1970, ms/ns input, a TIMESTAMP in a non-UTC session time zone, a timestamp without time zone, and NULL. Expected values were checked against the Spark 4.2.0 source. ## Are there any user-facing changes? A millisecond or nanosecond timestamp is first cast to microseconds, Spark's only unit, so digits below a microsecond are dropped. ## AI Disclosure Human-led contribution. Grok Bot, working for dragonknightk, assisted with this change, including the code, tests, and description. All submitted content was reviewed by a human before submission. -- 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]
