Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6851

Improve built-in scalar function when upgrade calcite version to 1.13

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Abandoned
    • None
    • None
    • Table SQL / API
    • None

    Description

      I found that the difference between calcite 1.12 and calcite master affects the semantics of the build-in scalar function, for example:
      The SQL:

      select 
      timestampadd(MONTH, 1,  date '2016-05-31'), 
      timestampadd(MONTH, 5,  date '2016-01-31'), 
      timestampadd(MONTH, -1, date '2016-03-31') from depts;
      

      Calcite 1.12 Result:

      +--------+--------+--------+
      | EXPR$0 | EXPR$1 | EXPR$2 |
      +--------+--------+--------+
      | 2016-07-01 | 2016-07-01 | 2016-03-01 |
      +--------+--------+--------+
      3 rows selected (1.06 seconds)
      

      Calcite Master result:

      +--------+--------+--------+
      | EXPR$0 | EXPR$1 | EXPR$2 |
      +--------+--------+--------+
      | 2016-06-30 | 2016-06-30 | 2016-02-29 |
      +--------+--------+--------+
      3 rows selected (1.047 seconds)
      

      The MSSQL result:

      select
        dateadd(MONTH, 1, '2016-05-31'),
        dateadd(MONTH, 5, '2016-01-31'),
        dateadd(MONTH, -1,'2016-03-31') from pvt;
      2016-06-30 00:00:00 2016-06-30 00:00:00 2016-02-29 00:00:00
      

      So, when we flink upgrade the calcite version to 1.13. we can open some useful feature. e.g: TIMESTAMPADD(SqlTypeFamily.ANY, SqlTypeFamily.INTEGER, SqlTypeFamily.DATE).

      So, In this JIRA. will create some subtask to improve flink according to calcite 1.13.
      I appreciated if you can give me some feedback?

      Attachments

        Issue Links

          Activity

            People

              sunjincheng121 sunjincheng
              sunjincheng121 sunjincheng
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: