Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1620

random() in an SQL should generate RANDOM numbers

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.11.0
    • Component/s: Function/UDF
    • Labels:
      None

      Description

      random() function in projection list should generate different random numbers per each record. Currently it generates same numbers like below:

      SELECT o_custkey, o_totalprice, random(10) as rand from orders limit 10;

      o_custkey, o_totalprice, rand
      -------------------------------
      36901, 173665.47, 8
      78002, 46929.18, 8
      123314, 193846.25, 8
      136777, 32151.78, 8
      44485, 144659.2, 8
      55624, 58749.59, 8
      39136, 252004.18, 8
      130057, 208660.75, 8
      66958, 163243.98, 8
      61001, 58949.67, 8
      (10 rows, 1.195 sec, 178 B selected)

      1. TAJO-1620.patch
        2 kB
        Jongyoung Park

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user eminency opened a pull request:

        https://github.com/apache/tajo/pull/582

        TAJO-1620: random() in an SQL should generate RANDOM numbers

        One more exception case is added in ConstantFolding rule.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/eminency/tajo TAJO-1620

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/tajo/pull/582.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #582


        commit 1b9fbc3de114b4bc8721a2089546adc24328b78d
        Author: Jongyoung Park <eminency@gmail.com>
        Date: 2015-05-23T11:46:19Z

        Added exception case for random() in ConstantFolding


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user eminency opened a pull request: https://github.com/apache/tajo/pull/582 TAJO-1620 : random() in an SQL should generate RANDOM numbers One more exception case is added in ConstantFolding rule. You can merge this pull request into a Git repository by running: $ git pull https://github.com/eminency/tajo TAJO-1620 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/582.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #582 commit 1b9fbc3de114b4bc8721a2089546adc24328b78d Author: Jongyoung Park <eminency@gmail.com> Date: 2015-05-23T11:46:19Z Added exception case for random() in ConstantFolding
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12735010/TAJO-1620.patch
        against master revision release-0.9.0-rc0-305-gc1fe41a.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

        +1 checkstyle. The patch generated 0 code style errors.

        +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in tajo-plan.

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/798//testReport/
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/798//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12735010/TAJO-1620.patch against master revision release-0.9.0-rc0-305-gc1fe41a. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-plan. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/798//testReport/ Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/798//console This message is automatically generated.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jihoonson commented on the pull request:

        https://github.com/apache/tajo/pull/582#issuecomment-105237348

        +1. This patch does not contain any tests, but it is difficult to test random() function, I think.

        Show
        githubbot ASF GitHub Bot added a comment - Github user jihoonson commented on the pull request: https://github.com/apache/tajo/pull/582#issuecomment-105237348 +1. This patch does not contain any tests, but it is difficult to test random() function, I think.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/tajo/pull/582

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/582
        Hide
        jihoonson Jihoon Son added a comment -

        Committed to master.

        Show
        jihoonson Jihoon Son added a comment - Committed to master.
        Hide
        hudson Hudson added a comment -

        ABORTED: Integrated in Tajo-master-CODEGEN-build #355 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/355/)
        TAJO-1620: random() in an SQL should generate RANDOM numbers. (jihoonson: rev bbfa076e1c2f379116d276d4b939fb757d798e2e)

        • tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/rules/ConstantFolding.java
        • CHANGES
        Show
        hudson Hudson added a comment - ABORTED: Integrated in Tajo-master-CODEGEN-build #355 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/355/ ) TAJO-1620 : random() in an SQL should generate RANDOM numbers. (jihoonson: rev bbfa076e1c2f379116d276d4b939fb757d798e2e) tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/rules/ConstantFolding.java CHANGES
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #715 (See https://builds.apache.org/job/Tajo-master-build/715/)
        TAJO-1620: random() in an SQL should generate RANDOM numbers. (jihoonson: rev bbfa076e1c2f379116d276d4b939fb757d798e2e)

        • CHANGES
        • tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/rules/ConstantFolding.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #715 (See https://builds.apache.org/job/Tajo-master-build/715/ ) TAJO-1620 : random() in an SQL should generate RANDOM numbers. (jihoonson: rev bbfa076e1c2f379116d276d4b939fb757d798e2e) CHANGES tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/rules/ConstantFolding.java

          People

          • Assignee:
            eminency Jongyoung Park
            Reporter:
            ykko Youngkyong Ko
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development