You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/06/16 17:45:43 UTC

[GitHub] [arrow-rs] alamb opened a new issue, #4424: Regression in 42.0.0: Parsing fractional intervals without leading 0 is not supported

alamb opened a new issue, #4424:
URL: https://github.com/apache/arrow-rs/issues/4424

   **Describe the bug**
   in version 41.0.0 an interval such as `.5 months` was parsed correctly
   
   In version 42.0.0 (not yet released at the time of this writing) it fails with an error: `NotYetImplemented("Unsupported Interval Expression with value ".5 months")`
   
   
   **To Reproduce**
   Try to parse `0.5` 
   
   Here is a unit test:
   
   ```diff
   diff --git a/arrow-cast/src/parse.rs b/arrow-cast/src/parse.rs
   index accce99b4..7984aeb9a 100644
   --- a/arrow-cast/src/parse.rs
   +++ b/arrow-cast/src/parse.rs
   @@ -1798,6 +1798,16 @@ mod tests {
                Interval::parse("-1.5 months -3.2 days", &config).unwrap(),
            );
    
   +        assert_eq!(
   +            Interval::new(0i32, 15i32, 0),
   +            Interval::parse("0.5 months", &config).unwrap(),
   +        );
   +
   +        assert_eq!(
   +            Interval::new(0i32, 15i32, 0),
   +            Interval::parse(".5 months", &config).unwrap(),
   +        );
   +
            assert_eq!(
                Interval::new(2i32, 10i32, 9 * NANOS_PER_HOUR),
                Interval::parse("2.1 months 7.25 days 3 hours", &config).unwrap(),
   ```
   
   The second case fails like this:
   ```
   ---- parse::tests::test_parse_interval stdout ----
   thread 'parse::tests::test_parse_interval' panicked at 'called `Result::unwrap()` on an `Err` value: NotYetImplemented("Unsupported Interval Expression with value \".5 months\"")', arrow-cast/src/parse.rs:1808:51
   stack backtrace:
   ```
   
   **Expected behavior**
   Both new cases should pass correctly
   
   **Additional context**
   Found while testing this upgrade in DataFusion


-- 
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.apache.org

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


[GitHub] [arrow-rs] alamb commented on issue #4424: Regression in 42.0.0: Parsing fractional intervals without leading 0 is not supported

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #4424:
URL: https://github.com/apache/arrow-rs/issues/4424#issuecomment-1595057242

   For better (likely for worse) `.5` is supported by postgres:
   
   ```
   postgres=# select interval '0.5 minutes';
    interval
   ----------
    00:00:30
   (1 row)
   
   postgres=# select interval '.5 minutes';
    interval
   ----------
    00:00:30
   (1 row)
   ```


-- 
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


[GitHub] [arrow-rs] alamb commented on issue #4424: Regression in 42.0.0: Parsing fractional intervals without leading 0 is not supported

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #4424:
URL: https://github.com/apache/arrow-rs/issues/4424#issuecomment-1595044927

   I believe this was introduced by https://github.com/apache/arrow-rs/pull/4291
   
   at ac9c6fa134280581c7e19750910b6c74153a75d4, these two (equivalent tests) pass:
   
   ```rust
   
           assert_eq!(
               (0i32, 15i32, 0),
               parse_interval("months", "0.5 months").unwrap(),
           );
   
           assert_eq!(
               (0i32, 15i32, 0),
               parse_interval("months", ".5 months").unwrap(),
           );
    
   ````
   
   at72f84b21d5826238392a1c03518e3dd625288ef1 , (with https://github.com/apache/arrow-rs/pull/4291), the reproducer fails:
   
   


-- 
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


[GitHub] [arrow-rs] tustvold closed issue #4424: Regression in 42.0.0: Parsing fractional intervals without leading 0 is not supported

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold closed issue #4424: Regression in 42.0.0: Parsing fractional intervals without leading 0 is not supported
URL: https://github.com/apache/arrow-rs/issues/4424


-- 
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