hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Häusler <mich...@akatose.de>
Subject error when using arrays of union types
Date Fri, 14 Nov 2014 11:37:40 GMT
Hi there,

it seems that it’s not possible to create an array of union types (see below). Is there
a workaround for this?

Best regards
Michael


In hive-0.14:

hive> SELECT ARRAY(CREATE_UNION(1, 1, 'a'));
OK
Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException:
Error evaluating array(create_union(1,1,'a'))
Time taken: 0.098 seconds


In hive-0.13:

hive> SELECT ARRAY(CREATE_UNION(1, 1, 'a'));
Query ID = haeusler_20141114112929_5ee86c17-e607-4f0f-a157-92699e4d5777
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_1415037444037_12008, Tracking URL = http://********:8088/proxy/application_1415037444037_12008/
Kill Command = /usr/lib/hadoop/bin/hadoop job  -kill job_1415037444037_12008
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
2014-11-14 11:29:50,699 Stage-1 map = 0%,  reduce = 0%
[…]
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating array(create_union(1,1,'a'))
        at org.apache.hadoop.hive.ql.exec.SelectOperator.processOp(SelectOperator.java:84)
        at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:793)
        at org.apache.hadoop.hive.ql.exec.TableScanOperator.processOp(TableScanOperator.java:92)
        at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:793)
        at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:539)
        ... 9 more
Caused by: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.objectinspector.StandardUnionObjectInspector
cannot be cast to org.apache.hadoop.io.IntWritable
        at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableIntObjectInspector.get(WritableIntObjectInspector.java:36)
        at org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.getInt(PrimitiveObjectInspectorUtils.java:598)
        at org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorConverter$IntConverter.convert(PrimitiveObjectInspectorConverter.java:150)
        at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters$UnionConverter.convert(ObjectInspectorConverters.java:456)
        at org.apache.hadoop.hive.ql.udf.generic.GenericUDFArray.evaluate(GenericUDFArray.java:79)
        at org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator._evaluate(ExprNodeGenericFuncEvaluator.java:166)
        at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:77)
        at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:65)
        at org.apache.hadoop.hive.ql.exec.SelectOperator.processOp(SelectOperator.java:79)
        ... 13 more

Mime
View raw message