You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by am...@apache.org on 2011/08/08 06:29:48 UTC
svn commit: r1154816 - in /hive/trunk/ql/src:
java/org/apache/hadoop/hive/ql/exec/
java/org/apache/hadoop/hive/ql/udf/generic/ test/queries/clientnegative/
test/queries/clientpositive/ test/results/clientnegative/
test/results/clientpositive/
Author: amareshwari
Date: Mon Aug 8 04:29:47 2011
New Revision: 1154816
URL: http://svn.apache.org/viewvc?rev=1154816&view=rev
Log:
HIVE-1734. Implement map_keys() and map_values() UDFs. (Carl Steinbach via amareshwari)
Added:
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java
hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_num.q
hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_type.q
hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_num.q
hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_type.q
hive/trunk/ql/src/test/queries/clientpositive/udf_map_keys.q
hive/trunk/ql/src/test/queries/clientpositive/udf_map_values.q
hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_num.q.out
hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_type.q.out
hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_num.q.out
hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_type.q.out
hive/trunk/ql/src/test/results/clientpositive/udf_map_keys.q.out
hive/trunk/ql/src/test/results/clientpositive/udf_map_values.q.out
Modified:
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out
Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java?rev=1154816&r1=1154815&r2=1154816&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java Mon Aug 8 04:29:47 2011
@@ -162,6 +162,8 @@ import org.apache.hadoop.hive.ql.udf.gen
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFInstr;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFLocate;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMap;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMapKeys;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMapValues;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqual;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqualOrGreaterThan;
@@ -415,6 +417,8 @@ public final class FunctionRegistry {
registerGenericUDF("concat_ws", GenericUDFConcatWS.class);
registerGenericUDF("array_contains", GenericUDFArrayContains.class);
registerGenericUDF("sentences", GenericUDFSentences.class);
+ registerGenericUDF("map_keys", GenericUDFMapKeys.class);
+ registerGenericUDF("map_values", GenericUDFMapValues.class);
// Generic UDTF's
registerGenericUDTF("explode", GenericUDTFExplode.class);
Added: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java (added)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java Mon Aug 8 04:29:47 2011
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.udf.generic;
+
+import java.util.ArrayList;
+
+import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
+
+/**
+ * GenericUDFMapKeys.
+ *
+ */
+@Description(name = "map_keys", value = "_FUNC_(map) - "
+ + "Returns an unordered array containing the keys of the input map.")
+public class GenericUDFMapKeys extends GenericUDF {
+ private MapObjectInspector mapOI;
+ private final ArrayList<Object> retArray = new ArrayList<Object>();
+
+ @Override
+ public ObjectInspector initialize(ObjectInspector[] arguments)
+ throws UDFArgumentException {
+ if (arguments.length != 1) {
+ throw new UDFArgumentLengthException("The function MAP_KEYS only accepts one argument.");
+ } else if (!(arguments[0] instanceof MapObjectInspector)) {
+ throw new UDFArgumentTypeException(0, "\""
+ + Category.MAP.toString().toLowerCase()
+ + "\" is expected at function MAP_KEYS, " + "but \""
+ + arguments[0].getTypeName() + "\" is found");
+ }
+
+ mapOI = (MapObjectInspector) arguments[0];
+ ObjectInspector mapKeyOI = mapOI.getMapKeyObjectInspector();
+ return ObjectInspectorFactory.getStandardListObjectInspector(mapKeyOI);
+ }
+
+ @Override
+ public Object evaluate(DeferredObject[] arguments) throws HiveException {
+ retArray.clear();
+ Object mapObj = arguments[0].get();
+ retArray.addAll(mapOI.getMap(mapObj).keySet());
+ return retArray;
+ }
+
+ @Override
+ public String getDisplayString(String[] children) {
+ assert children.length == 1;
+ return "map_keys(" + children[0] + ")";
+ }
+}
Added: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java (added)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java Mon Aug 8 04:29:47 2011
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.udf.generic;
+
+import java.util.ArrayList;
+
+import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
+
+/**
+ * GenericUDFMapValues.
+ *
+ */
+@Description(name = "map_values", value = "_FUNC_(map) - "
+ + "Returns an unordered array containing the values of the input map.")
+public class GenericUDFMapValues extends GenericUDF {
+ private MapObjectInspector mapOI;
+ private final ArrayList<Object> retArray = new ArrayList<Object>();
+
+ @Override
+ public ObjectInspector initialize(ObjectInspector[] arguments)
+ throws UDFArgumentException {
+ if (arguments.length != 1) {
+ throw new UDFArgumentLengthException("The function MAP_VALUES only accepts 1 argument.");
+ } else if (!(arguments[0] instanceof MapObjectInspector)) {
+ throw new UDFArgumentTypeException(0, "\""
+ + Category.MAP.toString().toLowerCase()
+ + "\" is expected at function MAP_VALUES, " + "but \""
+ + arguments[0].getTypeName() + "\" is found");
+ }
+
+ mapOI = (MapObjectInspector) arguments[0];
+ ObjectInspector mapValueOI = mapOI.getMapValueObjectInspector();
+ return ObjectInspectorFactory.getStandardListObjectInspector(mapValueOI);
+ }
+
+ @Override
+ public Object evaluate(DeferredObject[] arguments) throws HiveException {
+ retArray.clear();
+ Object mapObj = arguments[0].get();
+ retArray.addAll(mapOI.getMap(mapObj).values());
+ return retArray;
+ }
+
+ @Override
+ public String getDisplayString(String[] children) {
+ assert children.length == 1;
+ return "map_values(" + children[0] + ")";
+ }
+}
Added: hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_num.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_num.q?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_num.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_num.q Mon Aug 8 04:29:47 2011
@@ -0,0 +1 @@
+SELECT map_keys(map("a", "1"), map("b", "2")) FROM src LIMIT 1;
Added: hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_type.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_type.q?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_type.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/udf_map_keys_arg_type.q Mon Aug 8 04:29:47 2011
@@ -0,0 +1 @@
+SELECT map_keys(array(1, 2, 3)) FROM src LIMIT 1;
Added: hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_num.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_num.q?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_num.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_num.q Mon Aug 8 04:29:47 2011
@@ -0,0 +1 @@
+SELECT map_values(map("a", "1"), map("b", "2")) FROM src LIMIT 1;
Added: hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_type.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_type.q?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_type.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/udf_map_values_arg_type.q Mon Aug 8 04:29:47 2011
@@ -0,0 +1 @@
+SELECT map_values(array(1, 2, 3, 4)) FROM src LIMIT 1;
Added: hive/trunk/ql/src/test/queries/clientpositive/udf_map_keys.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/udf_map_keys.q?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/udf_map_keys.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/udf_map_keys.q Mon Aug 8 04:29:47 2011
@@ -0,0 +1,11 @@
+use default;
+-- Test map_keys() UDF
+
+DESCRIBE FUNCTION map_keys;
+DESCRIBE FUNCTION EXTENDED map_keys;
+
+-- Evaluate function against INT valued keys
+SELECT map_keys(map(1, "a", 2, "b", 3, "c")) FROM src LIMIT 1;
+
+-- Evaluate function against STRING valued keys
+SELECT map_keys(map("a", 1, "b", 2, "c", 3)) FROM src LIMIT 1;
Added: hive/trunk/ql/src/test/queries/clientpositive/udf_map_values.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/udf_map_values.q?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/udf_map_values.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/udf_map_values.q Mon Aug 8 04:29:47 2011
@@ -0,0 +1,11 @@
+use default;
+-- Test map_values() UDF
+
+DESCRIBE FUNCTION map_values;
+DESCRIBE FUNCTION EXTENDED map_values;
+
+-- Evaluate function against STRING valued values
+SELECT map_values(map(1, "a", 2, "b", 3, "c")) FROM src LIMIT 1;
+
+-- Evaluate function against INT valued keys
+SELECT map_values(map("a", 1, "b", 2, "c", 3)) FROM src LIMIT 1;
Added: hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_num.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_num.q.out?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_num.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_num.q.out Mon Aug 8 04:29:47 2011
@@ -0,0 +1 @@
+FAILED: Error in semantic analysis: Line 1:7 Arguments length mismatch '"2"': The function MAP_KEYS only accepts one argument.
Added: hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_type.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_type.q.out?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_type.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/udf_map_keys_arg_type.q.out Mon Aug 8 04:29:47 2011
@@ -0,0 +1 @@
+FAILED: Error in semantic analysis: Line 1:16 Argument type mismatch '3': "map" is expected at function MAP_KEYS, but "array<int>" is found
Added: hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_num.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_num.q.out?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_num.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_num.q.out Mon Aug 8 04:29:47 2011
@@ -0,0 +1 @@
+FAILED: Error in semantic analysis: Line 1:7 Arguments length mismatch '"2"': The function MAP_VALUES only accepts 1 argument.
Added: hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_type.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_type.q.out?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_type.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/udf_map_values_arg_type.q.out Mon Aug 8 04:29:47 2011
@@ -0,0 +1 @@
+FAILED: Error in semantic analysis: Line 1:18 Argument type mismatch '4': "map" is expected at function MAP_VALUES, but "array<int>" is found
Modified: hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out?rev=1154816&r1=1154815&r2=1154816&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out Mon Aug 8 04:29:47 2011
@@ -91,6 +91,8 @@ lower
lpad
ltrim
map
+map_keys
+map_values
max
min
minute
Added: hive/trunk/ql/src/test/results/clientpositive/udf_map_keys.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/udf_map_keys.q.out?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/udf_map_keys.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/udf_map_keys.q.out Mon Aug 8 04:29:47 2011
@@ -0,0 +1,40 @@
+PREHOOK: query: use default
+PREHOOK: type: SWITCHDATABASE
+POSTHOOK: query: use default
+POSTHOOK: type: SWITCHDATABASE
+PREHOOK: query: -- Test map_keys() UDF
+
+DESCRIBE FUNCTION map_keys
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: -- Test map_keys() UDF
+
+DESCRIBE FUNCTION map_keys
+POSTHOOK: type: DESCFUNCTION
+map_keys(map) - Returns an unordered array containing the keys of the input map.
+PREHOOK: query: DESCRIBE FUNCTION EXTENDED map_keys
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION EXTENDED map_keys
+POSTHOOK: type: DESCFUNCTION
+map_keys(map) - Returns an unordered array containing the keys of the input map.
+PREHOOK: query: -- Evaluate function against INT valued keys
+SELECT map_keys(map(1, "a", 2, "b", 3, "c")) FROM src LIMIT 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2011-08-04_23-18-58_296_9108820645412211778/-mr-10000
+POSTHOOK: query: -- Evaluate function against INT valued keys
+SELECT map_keys(map(1, "a", 2, "b", 3, "c")) FROM src LIMIT 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2011-08-04_23-18-58_296_9108820645412211778/-mr-10000
+[1,2,3]
+PREHOOK: query: -- Evaluate function against STRING valued keys
+SELECT map_keys(map("a", 1, "b", 2, "c", 3)) FROM src LIMIT 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2011-08-04_23-19-04_267_2431051360518045221/-mr-10000
+POSTHOOK: query: -- Evaluate function against STRING valued keys
+SELECT map_keys(map("a", 1, "b", 2, "c", 3)) FROM src LIMIT 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2011-08-04_23-19-04_267_2431051360518045221/-mr-10000
+["b","a","c"]
Added: hive/trunk/ql/src/test/results/clientpositive/udf_map_values.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/udf_map_values.q.out?rev=1154816&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/udf_map_values.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/udf_map_values.q.out Mon Aug 8 04:29:47 2011
@@ -0,0 +1,40 @@
+PREHOOK: query: use default
+PREHOOK: type: SWITCHDATABASE
+POSTHOOK: query: use default
+POSTHOOK: type: SWITCHDATABASE
+PREHOOK: query: -- Test map_values() UDF
+
+DESCRIBE FUNCTION map_values
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: -- Test map_values() UDF
+
+DESCRIBE FUNCTION map_values
+POSTHOOK: type: DESCFUNCTION
+map_values(map) - Returns an unordered array containing the values of the input map.
+PREHOOK: query: DESCRIBE FUNCTION EXTENDED map_values
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION EXTENDED map_values
+POSTHOOK: type: DESCFUNCTION
+map_values(map) - Returns an unordered array containing the values of the input map.
+PREHOOK: query: -- Evaluate function against STRING valued values
+SELECT map_values(map(1, "a", 2, "b", 3, "c")) FROM src LIMIT 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2011-08-04_23-19-10_440_3825624243726375363/-mr-10000
+POSTHOOK: query: -- Evaluate function against STRING valued values
+SELECT map_values(map(1, "a", 2, "b", 3, "c")) FROM src LIMIT 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2011-08-04_23-19-10_440_3825624243726375363/-mr-10000
+["a","b","c"]
+PREHOOK: query: -- Evaluate function against INT valued keys
+SELECT map_values(map("a", 1, "b", 2, "c", 3)) FROM src LIMIT 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2011-08-04_23-19-17_803_4547220042289617300/-mr-10000
+POSTHOOK: query: -- Evaluate function against INT valued keys
+SELECT map_values(map("a", 1, "b", 2, "c", 3)) FROM src LIMIT 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2011-08-04_23-19-17_803_4547220042289617300/-mr-10000
+[2,1,3]