[ https://issues.apache.org/jira/browse/HIVE-1734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13079060#comment-13079060 ]
jirapos...@reviews.apache.org commented on HIVE-1734: ----------------------------------------------------- bq. On 2011-08-01 10:03:11, Amareshwari Sriramadasu wrote: bq. > ql/src/test/results/clientpositive/udf_map_keys.q.out, line 40 bq. > <https://reviews.apache.org/r/1082/diff/1/?file=22333#file22333line40> bq. > bq. > Shouldn't the output be ["a", "b", "c"] here? The set of key/value pairs in a Map is unordered, and the same property also applies if you look only at the set of keys, or the set of values. Unfortunately, Hive's type system does not have a 'set' type, so we're forced to return the result of map_keys() and map_values() as an array, which implies that the set is ordered when it really isn't. If you want to apply a specific ordering property to the output of map_keys() or map_values(), then you would have to do this with a sort(array) UDF (which is not yet implemented). bq. On 2011-08-01 10:03:11, Amareshwari Sriramadasu wrote: bq. > ql/src/test/results/clientpositive/udf_map_values.q.out, line 40 bq. > <https://reviews.apache.org/r/1082/diff/1/?file=22334#file22334line40> bq. > bq. > Shouldn't the output be [1,2,3] instead of [2,1,3]? No. See previous comment. - Carl ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1082/#review1247 ----------------------------------------------------------- On 2011-07-12 00:40:11, Carl Steinbach wrote: bq. bq. ----------------------------------------------------------- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/1082/ bq. ----------------------------------------------------------- bq. bq. (Updated 2011-07-12 00:40:11) bq. bq. bq. Review request for hive. bq. bq. bq. Summary bq. ------- bq. bq. This patch adds map_keys(map) and map_values(map) UDFs. bq. bq. bq. This addresses bug HIVE-1734. bq. https://issues.apache.org/jira/browse/HIVE-1734 bq. bq. bq. Diffs bq. ----- bq. bq. ql/src/test/results/clientpositive/udf_map_values.q.out PRE-CREATION bq. ql/src/test/results/clientpositive/udf_map_keys.q.out PRE-CREATION bq. ql/src/test/queries/clientpositive/udf_map_values.q PRE-CREATION bq. ql/src/test/results/clientnegative/udf_map_keys_arg_num.q.out PRE-CREATION bq. ql/src/test/results/clientnegative/udf_map_keys_arg_type.q.out PRE-CREATION bq. ql/src/test/results/clientnegative/udf_map_values_arg_num.q.out PRE-CREATION bq. ql/src/test/results/clientnegative/udf_map_values_arg_type.q.out PRE-CREATION bq. ql/src/test/results/clientpositive/show_functions.q.out d4f6c98 bq. ql/src/test/queries/clientnegative/udf_map_values_arg_num.q PRE-CREATION bq. ql/src/test/queries/clientnegative/udf_map_values_arg_type.q PRE-CREATION bq. ql/src/test/queries/clientpositive/udf_map_keys.q PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 16a207e bq. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java PRE-CREATION bq. ql/src/test/queries/clientnegative/udf_map_keys_arg_num.q PRE-CREATION bq. ql/src/test/queries/clientnegative/udf_map_keys_arg_type.q PRE-CREATION bq. bq. Diff: https://reviews.apache.org/r/1082/diff bq. bq. bq. Testing bq. ------- bq. bq. bq. Thanks, bq. bq. Carl bq. bq. > Implement map_keys() and map_values() UDFs > ------------------------------------------ > > Key: HIVE-1734 > URL: https://issues.apache.org/jira/browse/HIVE-1734 > Project: Hive > Issue Type: New Feature > Components: UDF > Affects Versions: 0.6.0 > Reporter: Carl Steinbach > Assignee: Carl Steinbach > Attachments: HIVE-1734-mapudf.1.patch.txt, MapKeys.java, > MapValues.java > > > Implement the following UDFs: > <array> map_keys(<map>) > and > <array> map_values(<map>) > map_keys() takes a map as input and returns an array consisting of the key > values in the supplied map. > Similarly, map_values() takes a map as input and returns an array containing > the map value fields. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira