- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.9k
ARROW-12278: [Rust][DataFusion] Use Timestamp(Nanosecond, None) for SQL TIMESTAMP Type #9936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed so that CREATE EXTERNAL TABLE is handled correctly
        
          
                rust/datafusion/src/sql/planner.rs
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual code change in this PR
fae1e02    to
    fd6e344      
    Compare
  
    | FYI @Dandandan / @seddonm1 / @ovr | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nice catch.
Random though: I think that we would benefit from not writing a test on Context to test the SQL planner. It could be easier to identify which tests are testing what by writing unit tests more specialized to the component that they affect, as they usually declare the API behavior and are easier to find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a wild println has appeared :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no! I will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
fd6e344    to
    b6fbc1e      
    Compare
  
    | 
 @jorgecarleitao  I think the core of the problem is that the tests in  What would you think about refactoring the non  | 
Rationale
Running the query
CREATE EXTERNAL TABLE .. (c TIMESTAMP)today in DataFusion will result in a data type pf "Date64" which means that anything more specific than the date will be ignored.This leads to strange behavior such as
(note that the Time part is chopped off)
Changes
This PR changes the default mapping from SQL type
TIMESTAMP