You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "yadavay-amzn (via GitHub)" <gi...@apache.org> on 2026/07/01 18:10:56 UTC
[PR] [SPARK-57810][SQL] Infer nanosecond-precision timestamp types in XML schema inference [spark]
yadavay-amzn opened a new pull request, #56935:
URL: https://github.com/apache/spark/pull/56935
### What changes were proposed in this pull request?
Extends XML schema inference (`XmlInferSchema`) to infer nanosecond-precision timestamp types. A timestamp string with more than 6 fractional-second digits (with timezone info) now infers as the nanosecond LTZ timestamp type, mirroring the existing nanosecond NTZ inference in the same file and the JSON/CSV nanosecond-inference approach. Behavior is gated on the existing nanosecond-timestamp config; values with <= 6 fractional digits still infer as the microsecond `TimestampType`.
### Why are the changes needed?
Part of nanosecond-precision timestamp support (SPARK-56822). XML inference previously truncated sub-microsecond timestamps to microsecond precision; it should infer the nanosecond type when the data warrants it, consistent with JSON and CSV.
### Does this PR introduce _any_ user-facing change?
Yes - with nanosecond timestamp types enabled, XML schema inference can infer a nanosecond-precision timestamp type for sub-microsecond timestamps (previously inferred as microsecond `TimestampType`).
### How was this patch tested?
`XmlInferSchemaSuite`: new tests covering pure-nanosecond inference, pure-microsecond (unchanged), mixed widening, and string fallback.
### Was this patch authored or co-authored using generative AI tooling?
Authored with assistance by Claude Opus 4.8.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57810][SQL] Infer nanosecond-precision timestamp types in XML schema inference [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #56935:
URL: https://github.com/apache/spark/pull/56935#issuecomment-4952085304
can we fix merge conflicts?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57810][SQL] Infer nanosecond-precision timestamp types in XML schema inference [spark]
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #56935:
URL: https://github.com/apache/spark/pull/56935#issuecomment-4875262326
@cloud-fan Could you review this PR, please.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57810][SQL] Infer nanosecond-precision timestamp types in XML schema inference [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on PR #56935:
URL: https://github.com/apache/spark/pull/56935#issuecomment-4952340855
Thanks for taking a look @cloud-fan , rebased the branch and resolved merge conflicts
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57810][SQL] Infer nanosecond-precision timestamp types in XML schema inference [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #56935:
URL: https://github.com/apache/spark/pull/56935#issuecomment-4958878309
**Merge Summary:**
- merged into master https://github.com/apache/spark/commit/00ba61d477abce9418d706b400ac27bc69c42714
- merged into branch-4.x https://github.com/apache/spark/commit/553a1906a13144548e588af71be79186411ac452
*Posted by `merge_spark_pr.py`*
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57810][SQL] Infer nanosecond-precision timestamp types in XML schema inference [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan closed pull request #56935: [SPARK-57810][SQL] Infer nanosecond-precision timestamp types in XML schema inference
URL: https://github.com/apache/spark/pull/56935
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org