Skip to content
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

[CALCITE-6241] Enable a few existing functions to hive library #4165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xuzifu666
Copy link
Member

Add hive as a supported library for functions that have already been implemented for other libraries.
issue: https://issues.apache.org/jira/browse/CALCITE-6241 and commucate with author make a new pr to finish it.

Copy link
Member

@caicancai caicancai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the bounds test of the function is not considered for the time being.

LGTM

@@ -134,7 +134,7 @@ private SqlLibraryOperators() {

/** The "DATE_ADD(date, numDays)" function
* (Spark) Returns the date that is num_days after start_date. */
@LibraryOperator(libraries = {SPARK})
@LibraryOperator(libraries = {SPARK, ORACLE, HIVE})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does hive support both DATE_ADD(date, interval) and DATE_ADD(date, numDays)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reminder, hive not support both, only support DATE_ADD(date, numDays), I would change it. @ILuffZhe

@@ -134,7 +134,7 @@ private SqlLibraryOperators() {

/** The "DATE_ADD(date, numDays)" function
* (Spark) Returns the date that is num_days after start_date. */
@LibraryOperator(libraries = {SPARK})
@LibraryOperator(libraries = {SPARK, ORACLE, HIVE})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You enable this in Oracle, do we have a test?

Copy link
Member Author

@xuzifu666 xuzifu666 Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove oracle~ it is my mistake.

@@ -2780,7 +2780,7 @@ In the following:
| m | expr1 <=> expr2 | Whether two values are equal, treating null values as the same, and it's similar to `IS NOT DISTINCT FROM`
| p | ACOSD(numeric) | Returns the inverse cosine of *numeric* in degrees as a double. Returns NaN if *numeric* is NaN. Fails if *numeric* is less than -1.0 or greater than 1.0.
| * | ACOSH(numeric) | Returns the inverse hyperbolic cosine of *numeric*
| o s | ADD_MONTHS(date, numMonths) | Returns the date that is *numMonths* after *date*
| o s h | ADD_MONTHS(date, numMonths) | Returns the date that is *numMonths* after *date*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function seems not being added above, please take a look and also make sure the reference's changing consistent with what in SqlLibraryOpetators.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had remove this function.

@xuzifu666 xuzifu666 force-pushed the calcite-6241 branch 2 times, most recently from 79cfb54 to 440101a Compare January 24, 2025 06:14
@ILuffZhe
Copy link
Contributor

@xuzifu666 The CI failed ,please make sure your change can pass on your machine, then push it so we can go forward.

@xuzifu666 xuzifu666 force-pushed the calcite-6241 branch 2 times, most recently from 01360c1 to f54e426 Compare January 24, 2025 09:55
@xuzifu666
Copy link
Member Author

@xuzifu666 The CI failed ,please make sure your change can pass on your machine, then push it so we can go forward.

@ILuffZhe CI is success, PTAL when you are free time, thanks~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants