Github user sv71294 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2412#discussion_r199070456
--- Diff:
integration/presto/src/main/java/org/apache/carbondata/presto/readers/BooleanStreamReader.java
---
@@ -17,91 +17,64 @@
package org.apache.carbondata.presto.readers;
-import java.io.IOException;
-
import org.apache.carbondata.core.cache.dictionary.Dictionary;
+import org.apache.carbondata.core.metadata.datatype.DataType;
import org.apache.carbondata.core.metadata.datatype.DataTypes;
+import
org.apache.carbondata.core.scan.result.vector.impl.CarbonColumnVectorImpl;
import org.apache.carbondata.core.util.DataTypeUtil;
import com.facebook.presto.spi.block.Block;
import com.facebook.presto.spi.block.BlockBuilder;
import com.facebook.presto.spi.block.BlockBuilderStatus;
+import com.facebook.presto.spi.type.BooleanType;
import com.facebook.presto.spi.type.Type;
-public class BooleanStreamReader extends AbstractStreamReader {
+public class BooleanStreamReader extends CarbonColumnVectorImpl
+ implements PrestoVectorBlockBuilder {
- private boolean isDictionary;
- private Dictionary dictionary;
+ protected int batchSize;
- public BooleanStreamReader() {
+ protected Type type = BooleanType.BOOLEAN;
- }
+ protected BlockBuilder builder;
- public BooleanStreamReader(boolean isDictionary, Dictionary dictionary) {
- this.isDictionary = isDictionary;
+ private Dictionary dictionary;
+
+ public BooleanStreamReader(int batchSize, DataType dataType, Dictionary
dictionary) {
+ super(batchSize, dataType);
+ this.batchSize = batchSize;
+ this.builder = type.createBlockBuilder(new BlockBuilderStatus(),
batchSize);
this.dictionary = dictionary;
}
- public Block readBlock(Type type) throws IOException {
--- End diff --
builder is created with constructor and insertion function is done within
the vector-filling process of CarbonColumnVectorImpl
---