-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20749][SQL] Built-in SQL Function Support - all variants of LEN[GTH] #18046
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
|
It seems you have the wrong JIRA number. Also, you need to add tests in |
|
Test build #77135 has finished for PR 18046 at commit
|
|
@maropu Thank you for pointing them out. I addressed both. |
|
Test build #77142 has started for PR 18046 at commit |
|
Jenkins, retest this please |
|
Test build #77143 has finished for PR 18046 at commit
|
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.
Is it 9 bits?
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.
Good catch. updated.
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.
Is it common that length function is just an alias of char_length?
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.
E.g., in mysql, length is an alias of octet_length.
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.
Seems length is also an alias of char_length in Hive.
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.
I think that length is an alias of octet_length in mysql. In postgreSql, length is alias an of char_length.
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.
Based on the ANSI SQL, LENGTH function as a synonym for CHAR_LENGTH.
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.
Seems you forget to update to operators.sql too?
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.
Thanks, updated.
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.
Should we use an example string which returns different results on character_length and octet_length?
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.
These test suites handles the case. I have just used a simple case like other operations in the file.
|
Test build #77146 has started for PR 18046 at commit |
|
Can we also update the doc of |
|
@viirya I agree with you. However, I leave it for consistency of documents among versions. |
|
Jenkins, retest this please |
|
Test build #77159 has started for PR 18046 at commit |
|
Test build #77190 has finished for PR 18046 at commit
|
|
Please run the following command to generate the result file: |
|
Test build #77208 has finished for PR 18046 at commit
|
|
Test build #77221 has finished for PR 18046 at commit
|
|
@gatorsmile thank you for your suggestion. |
|
@gatorsmile Do I have to do additional things for this PR? |
|
@kiszk Could you resolve the conflict? Thanks! |
|
Test build #77479 has started for PR 18046 at commit |
|
Jenkins, retest this please |
|
Test build #77482 has finished for PR 18046 at commit
|
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 function that returns the char length of the given string expression or number of bytes of the given binary expression.
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.
... that returns ...
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.
ditto
|
Test build #77488 has finished for PR 18046 at commit
|
|
ping @gatorsmile |
1 similar comment
|
ping @gatorsmile |
|
Test build #77926 has finished for PR 18046 at commit
|
|
Test build #77927 has finished for PR 18046 at commit
|
|
ping @gatorsmile |
|
Test build #78083 has started for PR 18046 at commit |
|
retest this please |
|
@kiszk Sorry, I missed this ping. |
|
Test build #78133 has finished for PR 18046 at commit
|
|
LGTM |
|
Thanks! Merging to master. |
What changes were proposed in this pull request?
This PR adds built-in SQL function
BIT_LENGTH(),CHAR_LENGTH(), andOCTET_LENGTH()functions.BIT_LENGTH()returns the bit length of the given string or binary expression.CHAR_LENGTH()returns the length of the given string or binary expression. (i.e. equal toLENGTH())OCTET_LENGTH()returns the byte length of the given string or binary expression.How was this patch tested?
Added new test suites for these three functions