alamb opened a new pull request, #2984:
URL: https://github.com/apache/arrow-datafusion/pull/2984

   # Which issue does this PR close?
   
   N/A
   
    # Rationale for this change
   
   Something I noticed while working on 
https://github.com/apache/arrow-datafusion/pull/2981/files was that the parsing 
of strings like `3 days` to interval constants was in the sql parser logic 
directly which made it somewhat hard to follow
   
   Since https://github.com/sqlparser-rs/sqlparser-rs/pull/517  added support 
for arbitrary `Expr`s as interval arguments (rather than just strings), I 
thought refactoring this code into a function would be a step towards 
supporting generic arguments
   
   It also made it it easier to write tests
   
   I was thinking eventually we could use some of the code from @avantgardnerio 
from https://github.com/apache/arrow-rs/pull/2031  in Arrow but before I did 
that  I wanted to make sure the existing code had reasonable test coverage (to 
make sure we didn't break things).
   
   # What changes are included in this PR?
   1. Pull interval parsing logic into its own module and function. I tried to 
not make any logical changes
   2. Add some (very) basic tests
   3. Add functions to easily create `ScalarValue::Interval*`
   
   # 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 add the `api 
change` label.
   -->


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

Reply via email to