diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/HashTableSinkOperator.java ql/src/java/org/apache/hadoop/hive/ql/exec/HashTableSinkOperator.java index 8a5c009..4352ffe 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/HashTableSinkOperator.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/HashTableSinkOperator.java @@ -96,12 +96,9 @@ protected transient MapJoinPersistableTableContainer[] mapJoinTables; protected transient MapJoinTableContainerSerDe[] mapJoinTableSerdes; - private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; - private static final MapJoinEagerRowContainer EMPTY_ROW_CONTAINER = new MapJoinEagerRowContainer(); - static { - EMPTY_ROW_CONTAINER.addRow(EMPTY_OBJECT_ARRAY); - } - + private final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; + private final MapJoinEagerRowContainer EMPTY_ROW_CONTAINER = new MapJoinEagerRowContainer(); + private long rowNumber = 0; protected transient LogHelper console; private long hashTableScale; @@ -121,6 +118,7 @@ protected void initializeOp(Configuration hconf) throws HiveException { boolean isSilent = HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVESESSIONSILENT); console = new LogHelper(LOG, isSilent); memoryExhaustionHandler = new MapJoinMemoryExhaustionHandler(console, conf.getHashtableMemoryUsage()); + EMPTY_ROW_CONTAINER.addRow(EMPTY_OBJECT_ARRAY); // for small tables only; so get the big table position first posBigTableAlias = conf.getPosBigTable(); diff --git ql/src/test/results/clientpositive/spark/ppd_join4.q.out ql/src/test/results/clientpositive/spark/ppd_join4.q.out index d89b5ba..bdf1c4e 100644 --- ql/src/test/results/clientpositive/spark/ppd_join4.q.out +++ ql/src/test/results/clientpositive/spark/ppd_join4.q.out @@ -23,7 +23,6 @@ select 'a','b' from dual PREHOOK: type: QUERY PREHOOK: Input: default@dual PREHOOK: Output: default@test_tbl -Status: Failed POSTHOOK: query: insert into table test_tbl select 'a','b' from dual POSTHOOK: type: QUERY @@ -126,7 +125,6 @@ where t2.name='c' and t3.id='a' PREHOOK: type: QUERY PREHOOK: Input: default@test_tbl #### A masked pattern was here #### -Status: Failed POSTHOOK: query: select t2.* from (select id,name from (select id,name from test_tbl) t1 sort by id) t2 diff --git ql/src/test/results/clientpositive/spark/smb_mapjoin_25.q.out ql/src/test/results/clientpositive/spark/smb_mapjoin_25.q.out index 28bff98..df66cc2 100644 --- ql/src/test/results/clientpositive/spark/smb_mapjoin_25.q.out +++ ql/src/test/results/clientpositive/spark/smb_mapjoin_25.q.out @@ -292,7 +292,6 @@ PREHOOK: Input: default@smb_bucket_1 PREHOOK: Input: default@smb_bucket_2 PREHOOK: Input: default@smb_bucket_3 #### A masked pattern was here #### -Status: Failed POSTHOOK: query: select * from (select a.key from smb_bucket_1 a join smb_bucket_2 b on (a.key = b.key) where a.key = 5) t1 left outer join (select c.key from smb_bucket_2 c join smb_bucket_3 d on (c.key = d.key) where c.key=5) t2 on (t1.key=t2.key) where t2.key=5 POSTHOOK: type: QUERY POSTHOOK: Input: default@smb_bucket_1