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

'count(distinct x)' function counts first null value.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: Function/UDF
    • Labels:
      None

      Description

      The current count distinct function counts the first null value. Consider the following example column. The current count distinct function will count them as 4 instead of 3. We should fix it.

      \N
      A
      B
      B
      C
      

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user hyunsik opened a pull request:

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

        TAJO-994: 'count(distinct x)' function counts first null value.

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

        $ git pull https://github.com/hyunsik/tajo TAJO-994

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

        https://github.com/apache/tajo/pull/106.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 #106


        commit 2466c4a22133cc2cd495e5fc8c7126caf7586cc7
        Author: Hyunsik Choi <hyunsik@apache.org>
        Date: 2014-08-05T09:50:58Z

        TAJO-994: 'count(distinct x)' function counts first null value.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/106 TAJO-994 : 'count(distinct x)' function counts first null value. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-994 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/106.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 #106 commit 2466c4a22133cc2cd495e5fc8c7126caf7586cc7 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2014-08-05T09:50:58Z TAJO-994 : 'count(distinct x)' function counts first null value.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user blrunner commented on the pull request:

        https://github.com/apache/tajo/pull/106#issuecomment-51736017

        +1

        Thanks your contribution.
        I agree with your opinion and the patch looks good to me.
        'mvn clean install' finished successfully.

        Ship it.

        Show
        githubbot ASF GitHub Bot added a comment - Github user blrunner commented on the pull request: https://github.com/apache/tajo/pull/106#issuecomment-51736017 +1 Thanks your contribution. I agree with your opinion and the patch looks good to me. 'mvn clean install' finished successfully. Ship it.
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed it to master branch.

        Show
        hyunsik Hyunsik Choi added a comment - committed it to master branch.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

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

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/106
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #329 (See https://builds.apache.org/job/Tajo-master-build/329/)
        TAJO-994: 'count(distinct x)' function counts first null value. (hyunsik: rev fcc5da03ad1e9a692efad20aaf90a4005f9084d0)

        • tajo-core/src/test/resources/queries/TestGroupByQuery/testDistinctAggregationCaseByCase4.sql
        • CHANGES
        • tajo-core/src/test/resources/queries/TestGroupByQuery/testDistinctAggregationCaseByCase3.sql
        • tajo-core/src/test/resources/results/TestGroupByQuery/testDistinctAggregationCaseByCase4.result
        • tajo-core/src/test/resources/results/TestGroupByQuery/testDistinctAggregationCaseByCase3.result
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
        • tajo-core/src/main/java/org/apache/tajo/engine/function/builtin/CountValueDistinct.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #329 (See https://builds.apache.org/job/Tajo-master-build/329/ ) TAJO-994 : 'count(distinct x)' function counts first null value. (hyunsik: rev fcc5da03ad1e9a692efad20aaf90a4005f9084d0) tajo-core/src/test/resources/queries/TestGroupByQuery/testDistinctAggregationCaseByCase4.sql CHANGES tajo-core/src/test/resources/queries/TestGroupByQuery/testDistinctAggregationCaseByCase3.sql tajo-core/src/test/resources/results/TestGroupByQuery/testDistinctAggregationCaseByCase4.result tajo-core/src/test/resources/results/TestGroupByQuery/testDistinctAggregationCaseByCase3.result tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java tajo-core/src/main/java/org/apache/tajo/engine/function/builtin/CountValueDistinct.java

          People

          • Assignee:
            hyunsik Hyunsik Choi
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development