You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "stevomitric (via GitHub)" <gi...@apache.org> on 2026/09/05 21:12:08 UTC

[PR] [SPARK-56822][TESTS] Reuse the shared nanosecond truncation helper in timestamp nanos tests [spark]

stevomitric opened a new pull request, #58548:
URL: https://github.com/apache/spark/pull/58548

   
   ### What changes were proposed in this pull request?
   
   Replace the locally-duplicated sub-microsecond truncation helpers `floorNanosToPrecision` (in `CastSuiteBase`) and `flooredNano` (in `TimestampNanosRenderingSuiteBase`) with the shared production helper `SparkDateTimeUtils.truncateNanosWithinMicroToPrecision`, and delete the comments that described the duplicated rule. Pure test-only refactor: no production code and no assertion values change.
   
   ### Why are the changes needed?
   
   Both suites re-implemented, inline, the same sub-microsecond truncation rule that the code under test uses, so the expected values drifted away from a single source of truth. Both local copies were also non-exhaustive (`MatchError` on a precision outside [7, 9]) whereas the shared helper raises a clear internal error.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing suites pass unchanged: `CastWithAnsiOnSuite` / `CastWithAnsiOffSuite` (270 tests) and `TimestampNanosRenderingAnsiOnSuite` / `TimestampNanosRenderingAnsiOffSuite` (10 tests).
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Co-authored-by: Claude Opus 5
   


-- 
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-56822][TESTS] Reuse the shared nanosecond truncation helper in timestamp nanos tests [spark]

Posted by "stevomitric (via GitHub)" <gi...@apache.org>.
stevomitric commented on PR #58548:
URL: https://github.com/apache/spark/pull/58548#issuecomment-5555512766

   cc @uros-b PTAL.


-- 
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-56822][TESTS] Reuse the shared nanosecond truncation helper in timestamp nanos tests [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #58548:
URL: https://github.com/apache/spark/pull/58548#issuecomment-5560219379

   Thank you @stevomitric!


-- 
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-59282][TESTS] Reuse the shared nanosecond truncation helper in timestamp nanos tests [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b closed pull request #58548: [SPARK-59282][TESTS] Reuse the shared nanosecond truncation helper in timestamp nanos tests
URL: https://github.com/apache/spark/pull/58548


-- 
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-56822][TESTS] Reuse the shared nanosecond truncation helper in timestamp nanos tests [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #58548:
URL: https://github.com/apache/spark/pull/58548#issuecomment-5560241665

   @stevomitric just please update the PR title. Currently, it points to https://issues.apache.org/jira/browse/SPARK-56822 (which is the SPIP umbrella).


-- 
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-59282][TESTS] Reuse the shared nanosecond truncation helper in timestamp nanos tests [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #58548:
URL: https://github.com/apache/spark/pull/58548#issuecomment-5561799920

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/f9b447d3e6d6127ff223a3897762a6587c2cde88
   - merged into branch-4.x https://github.com/apache/spark/commit/9b73fde184158865d79073f5a040e355b75bb3e1
   
   *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