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

[FLINK-6811][table] Add TIMESTAMPADD supported in SQL #4076

Closed
wants to merge 1 commit into from

Conversation

sunjincheng121
Copy link
Member

@sunjincheng121 sunjincheng121 commented Jun 5, 2017

In this PR I have add TIMESTAMPADD supported in SQL. (the semantics keep consistent with calcite)

  • Syntax
    timestampAdd (datepart SqlTypeFamily.ANY, number:SqlTypeFamily.INTEGER, date:SqlTypeFamily.TIMESTAMP )
    -datepart
    Is the part of date to which an integer number is added.
    -number
    Is an expression that can be resolved to an int that is added to a datepart of date
    -date
    Is an expression that can be resolved to a time.

  • Example
    SELECT timestampAdd(month, 1, '2017-05-31') from tab; --> 2017-06-30 00:00:00.000

  • Note: Due to the difference of [[org.apache.calcite.rex.Rex Literal]] between calcite 1.12 and calcite master we should temp close support the construce of TIMESTAMPADD(SqlTypeFamily.ANY, SqlTypeFamily.INTEGER, SqlTypeFamily.DATE), until upgrade to calcite 1.13. See more https://issues.apache.org/jira/browse/FLINK-6851

  • General

    • The pull request references the related JIRA issue ("[FLINK-6811][table] Add TIMESTAMPADD supported in SQL")
    • The pull request addresses only one issue
    • Each commit in the PR has a meaningful commit message (including the JIRA id)
  • Documentation

    • Documentation has been added for new functionality
    • Old documentation affected by the pull request has been updated
    • JavaDoc for public methods has been added
  • Tests & Build

    • Functionality added by the pull request is covered by tests
    • mvn clean verify has been executed successfully locally or a Travis build has passed

@sunjincheng121 sunjincheng121 force-pushed the FLINK-6811-PR branch 4 times, most recently from c45379c to 8697656 Compare June 14, 2017 14:59
@sunjincheng121
Copy link
Member Author

Rebase code and add doc after FLINK-6960 & FLINK-6925.

@sunjincheng121 sunjincheng121 force-pushed the FLINK-6811-PR branch 3 times, most recently from e6bdcd1 to 655ba8a Compare June 26, 2017 07:22
@sunjincheng121
Copy link
Member Author

I have rebase the code and update the PR.

@twalthr
Copy link
Contributor

twalthr commented Jul 18, 2017

Thanks @sunjincheng121. Looks good to merge. I will merge this...

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

Successfully merging this pull request may close these issues.

4 participants