You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org> on 2010/11/13 02:32:18 UTC

[jira] Created: (HIVE-1790) Patch to support HAVING clause in Hive

Patch to support HAVING clause in Hive
--------------------------------------

                 Key: HIVE-1790
                 URL: https://issues.apache.org/jira/browse/HIVE-1790
             Project: Hive
          Issue Type: Improvement
            Reporter: Vaibhav Aggarwal
            Assignee: Vaibhav Aggarwal


Currently Hive users have to do nested queries in order to apply filter on group by expressions.
This patch allows users to directly apply filter on group by expressions by using HAVING clause.
This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-1790:
---------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

Committed. Thanks Vaibhav!

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.2.patch.txt, HIVE-1790.3.patch.txt, HIVE-1790.4.patch.txt, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932318#action_12932318 ] 

Vaibhav Aggarwal commented on HIVE-1790:
----------------------------------------

I have added test cases and have uploaded a new patch.

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932211#action_12932211 ] 

Vaibhav Aggarwal commented on HIVE-1790:
----------------------------------------

Hi

I think the patch is ready for review.
This is my first attempt though.

Thanks
Vaibhav

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973461#action_12973461 ] 

Vaibhav Aggarwal commented on HIVE-1790:
----------------------------------------

Hi

I have addressed all the user comments and have attached a new patch.

Please review the patch.

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.2.patch.txt, HIVE-1790.3.patch.txt, HIVE-1790.4.patch.txt, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vaibhav Aggarwal updated HIVE-1790:
-----------------------------------

    Attachment: HIVE-1790.patch

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>         Attachments: HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-1790:
---------------------------------

    Attachment: HIVE-1790.2.patch.txt

Attaching a new version of the patch that has been rebased to trunk. I could not
get the original to apply cleanly with patch -p0.

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.2.patch.txt, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vaibhav Aggarwal updated HIVE-1790:
-----------------------------------

    Attachment: HIVE-1790-1.patch

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971183#action_12971183 ] 

Carl Steinbach commented on HIVE-1790:
--------------------------------------

Posted review comments here: https://reviews.apache.org/r/162/



> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.2.patch.txt, HIVE-1790.3.patch.txt, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-1790:
---------------------------------

      Component/s: Query Processor
    Fix Version/s: 0.7.0
       Issue Type: New Feature  (was: Improvement)

@Vaibhav: is this ready for review, or are you still working on it?

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932219#action_12932219 ] 

Carl Steinbach commented on HIVE-1790:
--------------------------------------

@Vaibhav: can you please add some test cases to the patch and verify that they pass?

Directions explaining how to add tests are on the Hive wiki here: http://wiki.apache.org/hadoop/Hive/DeveloperGuide#Adding_new_unit_tests


> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932275#action_12932275 ] 

Vaibhav Aggarwal commented on HIVE-1790:
----------------------------------------

Hey Carl

Do you know how to access the schema and data in the staging tables?
I am not able to find the table "src" anywhere in the hive codebase.

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932280#action_12932280 ] 

Carl Steinbach commented on HIVE-1790:
--------------------------------------

The test tables are created by the QTestUtil.createSources() method located in ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java

The data used to initialize these tables is stored in the data/files directory.

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-1790:
---------------------------------

    Attachment: HIVE-1790.3.patch.txt

Accidentally picked up one of my own changes with the last patch. Attaching a new copy that includes
only Vaibhav's work.

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.2.patch.txt, HIVE-1790.3.patch.txt, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973463#action_12973463 ] 

Vaibhav Aggarwal commented on HIVE-1790:
----------------------------------------

Please note that I have not created a common method for genFilterPlan and genHavingPlan.
The genHavingPlan needs to populate the input row resolver with additional information related to column aliases.
It is not happening in genFilterPlan.
I don't think that there is lot of common code between the two methods. In this case I would prefer separate methods over if statements in code. It keeps the control flow much cleaner.

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.2.patch.txt, HIVE-1790.3.patch.txt, HIVE-1790.4.patch.txt, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Vaibhav Aggarwal (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vaibhav Aggarwal updated HIVE-1790:
-----------------------------------

    Attachment: HIVE-1790.4.patch.txt

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.2.patch.txt, HIVE-1790.3.patch.txt, HIVE-1790.4.patch.txt, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-1790) Patch to support HAVING clause in Hive

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-1790:
---------------------------------

    Status: Patch Available  (was: Open)

@Vaibhav: Please change the status of the ticket to "patch available" when 
'you're ready to have something reviewed.

> Patch to support HAVING clause in Hive
> --------------------------------------
>
>                 Key: HIVE-1790
>                 URL: https://issues.apache.org/jira/browse/HIVE-1790
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Vaibhav Aggarwal
>            Assignee: Vaibhav Aggarwal
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1790-1.patch, HIVE-1790.2.patch.txt, HIVE-1790.3.patch.txt, HIVE-1790.4.patch.txt, HIVE-1790.patch
>
>
> Currently Hive users have to do nested queries in order to apply filter on group by expressions.
> This patch allows users to directly apply filter on group by expressions by using HAVING clause.
> This patch also helps us integrate Hive with other data analysis tools which rely on HAVING expression.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.