You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "abacef (via GitHub)" <gi...@apache.org> on 2025/08/12 07:07:55 UTC

[PR] Timestamp to variant [arrow-rs]

abacef opened a new pull request, #8113:
URL: https://github.com/apache/arrow-rs/pull/8113

   # Which issue does this PR close?
   
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax.
   
   - Closes #8058 .
   
   # Rationale for this change
   
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   
   # What changes are included in this PR?
   
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   
   # Are these changes tested?
   
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   
   I am pretty sure I tested all the code paths
   
   # Are there any user-facing changes?
   
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   
   If there are any breaking changes to public APIs, please call them out.
   
   There is some documentation saying that nanoseconds will get truncated when converted
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Timestamp to variant [arrow-rs]

Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on code in PR #8113:
URL: https://github.com/apache/arrow-rs/pull/8113#discussion_r2269647158


##########
parquet-variant-compute/src/cast_to_variant.rs:
##########
@@ -175,6 +262,59 @@ mod tests {
     use parquet_variant::{Variant, VariantDecimal16};
     use std::{sync::Arc, vec};
 
+    #[test]
+    fn test_cast_to_variant_timestamp() {
+        let run_array_tests =
+            |microseconds: i64, array_ntz: Arc<dyn Array>, array_tz: Arc<dyn Array>| {
+                let timestamp = DateTime::from_timestamp_nanos(microseconds * 1000);
+                run_test(
+                    array_tz,
+                    vec![Some(Variant::TimestampMicros(timestamp)), None],

Review Comment:
   Yes, currently, `Variant::TimestampNanos`/`UUID`/`TimeNTZ` has not been supported, I added `TimeNTZ` in #8114



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Variant] Support Timestamp to variant for `cast_to_variant` kernel [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #8113:
URL: https://github.com/apache/arrow-rs/pull/8113


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Variant] Support Timestamp to variant for `cast_to_variant` kernel [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #8113:
URL: https://github.com/apache/arrow-rs/pull/8113#issuecomment-3184615423

   I merged up to resolve a conflict


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Variant] Support Timestamp to variant for `cast_to_variant` kernel [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #8113:
URL: https://github.com/apache/arrow-rs/pull/8113#issuecomment-3184873293

   Thanks again @abacef 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Timestamp to variant [arrow-rs]

Posted by "abacef (via GitHub)" <gi...@apache.org>.
abacef commented on PR #8113:
URL: https://github.com/apache/arrow-rs/pull/8113#issuecomment-3177992107

   This is pretty DRY so feel free to propose wetting it


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Timestamp to variant [arrow-rs]

Posted by "abacef (via GitHub)" <gi...@apache.org>.
abacef commented on code in PR #8113:
URL: https://github.com/apache/arrow-rs/pull/8113#discussion_r2268829191


##########
parquet-variant-compute/src/cast_to_variant.rs:
##########
@@ -175,6 +262,59 @@ mod tests {
     use parquet_variant::{Variant, VariantDecimal16};
     use std::{sync::Arc, vec};
 
+    #[test]
+    fn test_cast_to_variant_timestamp() {
+        let run_array_tests =
+            |microseconds: i64, array_ntz: Arc<dyn Array>, array_tz: Arc<dyn Array>| {
+                let timestamp = DateTime::from_timestamp_nanos(microseconds * 1000);
+                run_test(
+                    array_tz,
+                    vec![Some(Variant::TimestampMicros(timestamp)), None],

Review Comment:
   Rust variant support does not include `Variant::TimestampNanos` [link](https://github.com/apache/parquet-format/blob/1dbc814b97c9307687a2e4bee55545ab6a2ef106/VariantEncoding.md?plain=1#L428)?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Timestamp to variant [arrow-rs]

Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on code in PR #8113:
URL: https://github.com/apache/arrow-rs/pull/8113#discussion_r2269647158


##########
parquet-variant-compute/src/cast_to_variant.rs:
##########
@@ -175,6 +262,59 @@ mod tests {
     use parquet_variant::{Variant, VariantDecimal16};
     use std::{sync::Arc, vec};
 
+    #[test]
+    fn test_cast_to_variant_timestamp() {
+        let run_array_tests =
+            |microseconds: i64, array_ntz: Arc<dyn Array>, array_tz: Arc<dyn Array>| {
+                let timestamp = DateTime::from_timestamp_nanos(microseconds * 1000);
+                run_test(
+                    array_tz,
+                    vec![Some(Variant::TimestampMicros(timestamp)), None],

Review Comment:
   Yes, currently, `Variant::TimestampNanos` has not been implemented



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org