You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Zheng Shao (JIRA)" <ji...@apache.org> on 2010/02/03 20:25:30 UTC

[jira] Created: (HIVE-1127) Add UDF to create struct

Add UDF to create struct
------------------------

                 Key: HIVE-1127
                 URL: https://issues.apache.org/jira/browse/HIVE-1127
             Project: Hadoop Hive
          Issue Type: New Feature
    Affects Versions: 0.6.0
            Reporter: Zheng Shao
            Assignee: Zheng Shao


We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".


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


[jira] Commented: (HIVE-1127) Add UDF to create struct

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829286#action_12829286 ] 

Ning Zhang commented on HIVE-1127:
----------------------------------

Will commit after tests.

> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-1127.1.patch, HIVE-1127.2.patch, HIVE-1127.3.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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


[jira] Updated: (HIVE-1127) Add UDF to create struct

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

Zheng Shao updated HIVE-1127:
-----------------------------

    Status: Patch Available  (was: Open)

> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-1127.1.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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


[jira] Commented: (HIVE-1127) Add UDF to create struct

Posted by "Paul Yang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829238#action_12829238 ] 

Paul Yang commented on HIVE-1127:
---------------------------------

* Shouldn't the for loops in evaluate() and getDisplayString() increment by 1, not 2?
* ArrayList<ObjectInspector> foi = new ArrayList<ObjectInspector>(Arrays.asList(arguments)); => Arrays.asList() sufficient? getStandardStructObjectInspector takes Lists as parameters.
* Using Object[] instead of ArrayList<Object> for ret may offer better performance, probably not by much.

Side note: Implementing user specified field names in a UDF is not possible with the current framework because the initialize() method requires returning a StructObjectInspector. Creating the StructObjectInspector requires knowing the field names, not just the field types.

> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-1127.1.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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


[jira] Updated: (HIVE-1127) Add UDF to create struct

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

Zheng Shao updated HIVE-1127:
-----------------------------

    Attachment: HIVE-1127.3.patch

Added the changes to show_functions.q.out

> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-1127.1.patch, HIVE-1127.2.patch, HIVE-1127.3.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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


[jira] Commented: (HIVE-1127) Add UDF to create struct

Posted by "Paul Yang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829285#action_12829285 ] 

Paul Yang commented on HIVE-1127:
---------------------------------

Looks good to me +1

> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-1127.1.patch, HIVE-1127.2.patch, HIVE-1127.3.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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


[jira] Updated: (HIVE-1127) Add UDF to create struct

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

Ning Zhang updated HIVE-1127:
-----------------------------

       Resolution: Fixed
    Fix Version/s: 0.6.0
           Status: Resolved  (was: Patch Available)

Committed. Thanks Zheng!

> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>             Fix For: 0.6.0
>
>         Attachments: HIVE-1127.1.patch, HIVE-1127.2.patch, HIVE-1127.3.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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


[jira] Updated: (HIVE-1127) Add UDF to create struct

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

Zheng Shao updated HIVE-1127:
-----------------------------

    Attachment: HIVE-1127.2.patch

Addressed the 3 points from Paul's comment.


> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-1127.1.patch, HIVE-1127.2.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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


[jira] Commented: (HIVE-1127) Add UDF to create struct

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829316#action_12829316 ] 

Zheng Shao commented on HIVE-1127:
----------------------------------

Thanks Ning!



> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>             Fix For: 0.6.0
>
>         Attachments: HIVE-1127.1.patch, HIVE-1127.2.patch, HIVE-1127.3.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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


[jira] Updated: (HIVE-1127) Add UDF to create struct

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

Zheng Shao updated HIVE-1127:
-----------------------------

    Attachment: HIVE-1127.1.patch

> Add UDF to create struct
> ------------------------
>
>                 Key: HIVE-1127
>                 URL: https://issues.apache.org/jira/browse/HIVE-1127
>             Project: Hadoop Hive
>          Issue Type: New Feature
>    Affects Versions: 0.6.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-1127.1.patch
>
>
> We want to create a single struct from multiple columns, so that we can pass it into functions like "max" to get the effect of "arg_max".

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