Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

hive queries are failing when I do joining.

Highlighted

hive queries are failing when I do joining.

Guru

When I am doing joins in hive queries and creating new table from output with jdbc then it is failing with below error.

Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Unexpected exception: org.apache.hadoop.hive.serde2.io.HiveVarcharWritable cannot be cast to org.apache.hadoop.hive.common.type.HiveVarchar

	at org.apache.hadoop.hive.ql.exec.MapJoinOperator.processOp(MapJoinOperator.java:311)
	at org.apache.hadoop.hive.ql.exec.vector.VectorMapJoinOperator.processOp(VectorMapJoinOperator.java:249)
	at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:815)
	at org.apache.hadoop.hive.ql.exec.vector.VectorFilterOperator.processOp(VectorFilterOperator.java:111)
	at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:815)
	at org.apache.hadoop.hive.ql.exec.TableScanOperator.processOp(TableScanOperator.java:95)
	at org.apache.hadoop.hive.ql.exec.MapOperator$MapOpCtx.forward(MapOperator.java:157)
	at org.apache.hadoop.hive.ql.exec.vector.VectorMapOperator.process(VectorMapOperator.java:45)
	... 9 more
6 REPLIES 6
Highlighted

Re: hive queries are failing when I do joining.

Mentor
@Saurabh Kumar

you are using a wrong datatype for one of the fields. Take a look at one of the string or varchar types you are casting something wrong

Highlighted

Re: hive queries are failing when I do joining.

Guru

@Artem Ervits: Below is my query and I don't see any wrong datatype as it is already craeted table and I am just creating from other tables. One more point I want to highlight is its working fine for odbc.

--Join the Attributes to the Queries (2,855 Matched)

DROP TABLE abc.test;

CREATE TABLE abc.test STORED

AS ORC TBLPROPERTIES ('orc.compress' = 'SNAPPY')

AS SELECT a.ll_cat, a.atr_nme, SUM(b.support) AS instances

FROM didb.jlp_atr_array_t a

INNER JOIN didb.jlp_t2c_array_t b

ON a.2nd_ll_cat = b.2nd_ll_cat

AND a.atr_val_split = b.prop13_split

GROUP BY a.ll_cat, a.atr_nme;

Highlighted

Re: hive queries are failing when I do joining.

Mentor
@Saurabh Kumar

describe both tables and compare field types.

Highlighted

Re: hive queries are failing when I do joining.

@Saurabh Kumar

Take a look on this..What version of hive? https://issues.apache.org/jira/browse/HIVE-11054

Highlighted

Re: hive queries are failing when I do joining.

Guru

@Neeraj Sabharwal: Yes it looks like it is similar kind of issue but in my error massage I don't see any datatype like char or varchar. So I am not sure whether this patch will solve my issue. But I will test and will let you know about reseult.

Highlighted

Re: hive queries are failing when I do joining.

Can you please share the Hive version or HDP version.

The DDL of the 2 tables that you are joining?

Don't have an account?
Coming from Hortonworks? Activate your account here