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

IGNITE-20294 Sql. Using UDF as a place for system_range function #3666

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

Conversation

zstan
Copy link
Contributor

@zstan zstan commented Apr 26, 2024

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes


/** Creates a {@link org.apache.calcite.schema.impl.TableFunctionImpl} from a class, looking for an "eval"
* method. Returns null if there is no such method. */
public static @Nullable TableFunction create(Class<?> clazz) {
Copy link
Contributor

@xtern xtern Apr 29, 2024

Choose a reason for hiding this comment

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

why do we need this method (and the following)?
p.s. I see "for eval" but can't figure out what's not working 😔

* @param name name of the method to find
* @return the first method with matching name or null when no method found
*/
static @Nullable Method findMethod(Class<?> clazz, String name) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to use this method in RexToLixTranslator and remove the same method from RexToLixTranslator?
or move it to some utility-class?

super(
"SYSTEM_RANGE",
new SqlIdentifier(funcName, SqlParserPos.ZERO),
Copy link
Contributor

Choose a reason for hiding this comment

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

What is a point of making a function name configurable, if this function can only used for a system range function?

* Implementation of {@link org.apache.calcite.schema.TableFunction} based on a
* method.
*/
public class TableFunctionImpl extends ReflectiveFunctionBase
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this one is copied? How it differs from calcite's TableFunctionImpl?

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