[
https://issues.apache.org/jira/browse/ARROW-1885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16277586#comment-16277586
]
ASF GitHub Bot commented on ARROW-1885:
---------------------------------------
icexelloss commented on a change in pull request #1389: ARROW-1885: [Java]
Restore MapVector class names prior to ARROW-1710
URL: https://github.com/apache/arrow/pull/1389#discussion_r154786386
##########
File path:
java/vector/src/main/java/org/apache/arrow/vector/complex/MapVector.java
##########
@@ -21,480 +21,322 @@
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
+import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
+import java.util.Map;
-import com.google.common.collect.ObjectArrays;
+import javax.annotation.Nullable;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Ordering;
+import com.google.common.primitives.Ints;
import io.netty.buffer.ArrowBuf;
-import org.apache.arrow.memory.BaseAllocator;
+
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.vector.*;
-import org.apache.arrow.vector.complex.impl.NullableMapReaderImpl;
-import org.apache.arrow.vector.complex.impl.NullableMapWriter;
+import org.apache.arrow.vector.complex.impl.SingleMapReaderImpl;
+import org.apache.arrow.vector.complex.reader.FieldReader;
import org.apache.arrow.vector.holders.ComplexHolder;
-import org.apache.arrow.vector.ipc.message.ArrowFieldNode;
+import org.apache.arrow.vector.types.Types.MinorType;
import org.apache.arrow.vector.types.pojo.ArrowType;
-import org.apache.arrow.vector.types.pojo.ArrowType.Struct;
-import org.apache.arrow.vector.types.pojo.DictionaryEncoding;
-import org.apache.arrow.vector.types.pojo.FieldType;
import org.apache.arrow.vector.types.pojo.Field;
+import org.apache.arrow.vector.types.pojo.FieldType;
import org.apache.arrow.vector.util.CallBack;
-import org.apache.arrow.vector.util.OversizedAllocationException;
+import org.apache.arrow.vector.util.JsonStringHashMap;
import org.apache.arrow.vector.util.TransferPair;
-public class MapVector extends NonNullableMapVector implements FieldVector {
+public class MapVector extends AbstractMapVector {
+ //private static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(MapVector.class);
public static MapVector empty(String name, BufferAllocator allocator) {
- FieldType fieldType = FieldType.nullable(Struct.INSTANCE);
+ FieldType fieldType = new FieldType(false, ArrowType.Struct.INSTANCE,
null, null);
return new MapVector(name, allocator, fieldType, null);
}
- private final NullableMapReaderImpl reader = new NullableMapReaderImpl(this);
- private final NullableMapWriter writer = new NullableMapWriter(this);
-
- protected ArrowBuf validityBuffer;
- private int validityAllocationSizeInBytes;
+ private final SingleMapReaderImpl reader = new SingleMapReaderImpl(this);
+ protected final FieldType fieldType;
+ public int valueCount;
// deprecated, use FieldType or static constructor instead
@Deprecated
public MapVector(String name, BufferAllocator allocator, CallBack callBack) {
- this(name, allocator, FieldType.nullable(ArrowType.Struct.INSTANCE),
callBack);
+ this(name, allocator, new FieldType(false, ArrowType.Struct.INSTANCE,
null, null), callBack);
}
- // deprecated, use FieldType or static constructor instead
- @Deprecated
- public MapVector(String name, BufferAllocator allocator, DictionaryEncoding
dictionary, CallBack callBack) {
- this(name, allocator, new FieldType(true, ArrowType.Struct.INSTANCE,
dictionary, null), callBack);
+ public MapVector(String name, BufferAllocator allocator, FieldType
fieldType, CallBack callBack) {
+ super(name, allocator, callBack);
+ this.fieldType = checkNotNull(fieldType);
+ this.valueCount = 0;
}
- public MapVector(String name, BufferAllocator allocator, FieldType
fieldType, CallBack callBack) {
- super(name, checkNotNull(allocator), fieldType, callBack);
- this.validityBuffer = allocator.getEmpty();
- this.validityAllocationSizeInBytes =
BitVectorHelper.getValidityBufferSize(BaseValueVector.INITIAL_VALUE_ALLOCATION);
+ @Override
+ public FieldReader getReader() {
+ return reader;
+ }
+
+ transient private MapTransferPair ephPair;
Review comment:
Oh sorry I should be clear - the variable name `ephPair` seems wrong - I
don't know if it has always been `ephPair` or somehow changed during
refactoring. Either way, seems worth fixing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [Java] Restore previous MapVector class names
> ---------------------------------------------
>
> Key: ARROW-1885
> URL: https://issues.apache.org/jira/browse/ARROW-1885
> Project: Apache Arrow
> Issue Type: Sub-task
> Components: Java - Vectors
> Reporter: Bryan Cutler
> Assignee: Bryan Cutler
> Labels: pull-request-available
> Fix For: 0.8.0
>
>
> Making changes to the MapVector class was not part of refactoring plan and
> should not have been done in ARROW-1710. This will restore class names to
> the previous state of {{NullableMapVector}} -> {{MapVector}} ->
> {{AbstractMapVector}}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)