Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1936

Allow ROUND() and TRUNCATE() to take only one operand

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.14.0
    • Component/s: core
    • Labels:
      None

      Description

      Some databases (e.g. Oracle and MS Sqlserver) allow ROUND and TRUNCATE to take only one operand for ease of use. For example, we could allow ROUND(12.3) to mean ROUND(12.3, 0), TRUNCATE(12.3, 0) to mean TRUNCATE(12.3).

        Activity

        Hide
        michaelmior Michael Mior added a comment -

        Resolved in release 1.14.0 (2017-10-01)

        Show
        michaelmior Michael Mior added a comment - Resolved in release 1.14.0 (2017-10-01)
        Hide
        julianhyde Julian Hyde added a comment -

        Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/bfaea7cc.

        I also made ROUND and TRUNCATE work when their 2nd argument is NULL.

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/bfaea7cc . I also made ROUND and TRUNCATE work when their 2nd argument is NULL.
        Hide
        julianhyde Julian Hyde added a comment -

        Reviewing and testing now.

        Show
        julianhyde Julian Hyde added a comment - Reviewing and testing now.
        Hide
        minjikim MinJi Kim added a comment -
        Show
        minjikim MinJi Kim added a comment - I updated the PR. Thanks! https://github.com/apache/calcite/pull/513
        Hide
        minjikim MinJi Kim added a comment -

        Yes, I meant TRUNCATE. I updated the title. I will also update the patch soon! Thanks!

        Show
        minjikim MinJi Kim added a comment - Yes, I meant TRUNCATE. I updated the title. I will also update the patch soon! Thanks!
        Hide
        julianhyde Julian Hyde added a comment -

        You mean TRUNCATE, not TRUNC?

        Can you update reference.md?

        Show
        julianhyde Julian Hyde added a comment - You mean TRUNCATE, not TRUNC? Can you update reference.md?
        Hide
        minjikim MinJi Kim added a comment -

        Here is a small patch for this jira. Please let me know what you think. Thanks!

        https://github.com/apache/calcite/pull/513

        Show
        minjikim MinJi Kim added a comment - Here is a small patch for this jira. Please let me know what you think. Thanks! https://github.com/apache/calcite/pull/513

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            minjikim MinJi Kim
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development