-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[Minor][SQL] Allow spaces in the beginning and ending of string for Interval #7390
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
Closed
Closed
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Sort-of related question -- why is this class in 'unsafe', and why not use Joda time? the JDK already has a rich set of abstractions for time. It seems like it's only used in catalyst.
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 class is the internal representation of interval type, written in Java for better performance, just like what we did for
UTF8String, that's why it's in 'unsafe'.Currently our date and timestamp internal representation is int and long, which is more efficient than Joda time I think.
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.
@cloud-fan maybe I'm blind but how does this use Unsafe? I don't see how it benefits.
java.time.Durationis anint+longtoo. Is this really needed? at least, why in unsafe?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.
@srowen don't hang up on the package name for now. It's just a place to put all the data types implemented in Java. We will most likely rename the package.
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.
One possible thing that could happen with unsafe for interval is to support reading directly from a memory address rather than materializing it as a long + an int.
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.
@rxin I'm not worried about the package so much as the module; this doesn't have to do with bit-twiddling via Unsafe. Is there really a win for managing 96 bits via Unsafe?
It doesn't seem like the right place for this type; it's only used by catalyst (now) I think, so could live there or at least core. But more than that, the JDK itself has a standard class for this -- around which you could build utility functions. I understand this is in flux but I suppose I'm not seeing why it landed here and wondering if it's better to move it early.