You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by gu...@apache.org on 2015/03/27 22:26:55 UTC
svn commit: r1669689 -
/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/MapJoinBytesTableContainer.java
Author: gunther
Date: Fri Mar 27 21:26:55 2015
New Revision: 1669689
URL: http://svn.apache.org/r1669689
Log:
HIVE-10082: Addendum: LLAP: UnwrappedRowContainer throws exceptions (Gunther Hagleitner)
Modified:
hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/MapJoinBytesTableContainer.java
Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/MapJoinBytesTableContainer.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/MapJoinBytesTableContainer.java?rev=1669689&r1=1669688&r2=1669689&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/MapJoinBytesTableContainer.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/MapJoinBytesTableContainer.java Fri Mar 27 21:26:55 2015
@@ -423,12 +423,14 @@ public class MapJoinBytesTableContainer
}
public void setFromOutput(Output output) {
- if (refs == null) {
- refs = new ArrayList<WriteBuffers.ByteSegmentRef>(0);
+ synchronized (hashMap) {
+ if (refs == null) {
+ refs = new ArrayList<WriteBuffers.ByteSegmentRef>(0);
+ }
+ byte aliasFilter = hashMap.getValueRefs(output.getData(), output.getLength(), refs);
+ this.aliasFilter = refs.isEmpty() ? (byte) 0xff : aliasFilter;
+ this.dummyRow = null;
}
- byte aliasFilter = hashMap.getValueRefs(output.getData(), output.getLength(), refs);
- this.aliasFilter = refs.isEmpty() ? (byte) 0xff : aliasFilter;
- this.dummyRow = null;
}
public boolean isEmpty() {
@@ -478,23 +480,28 @@ public class MapJoinBytesTableContainer
@Override
public List<Object> next() throws HiveException {
- if (dummyRow != null) {
- List<Object> result = dummyRow;
- dummyRow = null;
- return result;
+ synchronized (hashMap) {
+ if (dummyRow != null) {
+ List<Object> result = dummyRow;
+ dummyRow = null;
+ return result;
+ }
+ if (currentRow < 0 || refs.size() < currentRow)
+ throw new HiveException("No rows");
+ if (refs.size() == currentRow)
+ return null;
+ WriteBuffers.ByteSegmentRef ref = refs.get(currentRow++);
+ if (ref.getLength() == 0) {
+ return EMPTY_LIST; // shortcut, 0 length means no fields
+ }
+ if (ref.getBytes() == null) {
+ hashMap.populateValue(ref);
+ }
+ uselessIndirection.setData(ref.getBytes());
+ valueStruct.init(uselessIndirection, (int) ref.getOffset(), ref.getLength());
+ return valueStruct.getFieldsAsList(); // TODO: should we unset bytes
+ // after that?
}
- if (currentRow < 0 || refs.size() < currentRow) throw new HiveException("No rows");
- if (refs.size() == currentRow) return null;
- WriteBuffers.ByteSegmentRef ref = refs.get(currentRow++);
- if (ref.getLength() == 0) {
- return EMPTY_LIST; // shortcut, 0 length means no fields
- }
- if (ref.getBytes() == null) {
- hashMap.populateValue(ref);
- }
- uselessIndirection.setData(ref.getBytes());
- valueStruct.init(uselessIndirection, (int)ref.getOffset(), ref.getLength());
- return valueStruct.getFieldsAsList(); // TODO: should we unset bytes after that?
}
@Override