You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by he...@apache.org on 2017/03/09 13:31:28 UTC
[1/2] incubator-carbondata git commit: remove useless classes
Repository: incubator-carbondata
Updated Branches:
refs/heads/master 8fef247a9 -> f4f852e78
remove useless classes
Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/d246dae2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/d246dae2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/d246dae2
Branch: refs/heads/master
Commit: d246dae22554472c336b4507672b915ffcb2eac7
Parents: 8fef247
Author: lucao <wh...@gmail.com>
Authored: Thu Mar 9 13:51:39 2017 +0800
Committer: hexiaoqiao <he...@meituan.com>
Committed: Thu Mar 9 21:29:14 2017 +0800
----------------------------------------------------------------------
.../result/iterator/VectorChunkRowIterator.java | 91 -----------
.../vector/impl/CarbonColumnVectorImpl.java | 152 -------------------
2 files changed, 243 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/d246dae2/core/src/main/java/org/apache/carbondata/core/scan/result/iterator/VectorChunkRowIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/scan/result/iterator/VectorChunkRowIterator.java b/core/src/main/java/org/apache/carbondata/core/scan/result/iterator/VectorChunkRowIterator.java
deleted file mode 100644
index e7461a5..0000000
--- a/core/src/main/java/org/apache/carbondata/core/scan/result/iterator/VectorChunkRowIterator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.core.scan.result.iterator;
-
-import org.apache.carbondata.common.CarbonIterator;
-import org.apache.carbondata.core.scan.result.vector.CarbonColumnarBatch;
-
-/**
- * Iterator over row result
- */
-public class VectorChunkRowIterator extends CarbonIterator<Object[]> {
-
- /**
- * iterator over chunk result
- */
- private AbstractDetailQueryResultIterator iterator;
-
- /**
- * currect chunk
- */
- private CarbonColumnarBatch columnarBatch;
-
- private int batchSize;
-
- private int currentIndex;
-
- public VectorChunkRowIterator(AbstractDetailQueryResultIterator iterator,
- CarbonColumnarBatch columnarBatch) {
- this.iterator = iterator;
- this.columnarBatch = columnarBatch;
- if (iterator.hasNext()) {
- iterator.processNextBatch(columnarBatch);
- batchSize = columnarBatch.getActualSize();
- currentIndex = 0;
- }
- }
-
- /**
- * Returns {@code true} if the iteration has more elements. (In other words,
- * returns {@code true} if {@link #next} would return an element rather than
- * throwing an exception.)
- *
- * @return {@code true} if the iteration has more elements
- */
- @Override public boolean hasNext() {
- if (currentIndex < batchSize) {
- return true;
- } else {
- while (iterator.hasNext()) {
- columnarBatch.reset();
- iterator.processNextBatch(columnarBatch);
- batchSize = columnarBatch.getActualSize();
- currentIndex = 0;
- if (currentIndex < batchSize) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Returns the next element in the iteration.
- *
- * @return the next element in the iteration
- */
- @Override public Object[] next() {
- Object[] row = new Object[columnarBatch.columnVectors.length];
- for (int i = 0; i < row.length; i++) {
- row[i] = columnarBatch.columnVectors[i].getData(currentIndex);
- }
- currentIndex++;
- return row;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/d246dae2/core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java b/core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java
deleted file mode 100644
index d7b9221..0000000
--- a/core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.carbondata.core.scan.result.vector.impl;
-
-import java.util.Arrays;
-import java.util.BitSet;
-
-import org.apache.carbondata.core.metadata.datatype.DataType;
-import org.apache.carbondata.core.scan.result.vector.CarbonColumnVector;
-
-import org.apache.spark.sql.types.Decimal;
-import org.apache.spark.unsafe.types.UTF8String;
-
-public class CarbonColumnVectorImpl implements CarbonColumnVector {
-
- private Object[] data;
-
- private int[] ints;
-
- private long[] longs;
-
- private Decimal[] decimals;
-
- private byte[][] bytes;
-
- private double[] doubles;
-
- private BitSet nullBytes;
-
- private DataType dataType;
-
- public CarbonColumnVectorImpl(int batchSize, DataType dataType) {
- nullBytes = new BitSet(batchSize);
- this.dataType = dataType;
- switch (dataType) {
- case INT:
- ints = new int[batchSize];
- break;
- case LONG:
- longs = new long[batchSize];
- break;
- case DOUBLE:
- doubles = new double[batchSize];
- break;
- case STRING:
- bytes = new byte[batchSize][];
- break;
- case DECIMAL:
- decimals = new Decimal[batchSize];
- break;
- default:
- data = new Object[batchSize];
- }
- }
-
- @Override public void putShort(int rowId, short value) {
-
- }
-
- @Override public void putInt(int rowId, int value) {
- ints[rowId] = value;
- }
-
- @Override public void putLong(int rowId, long value) {
- longs[rowId] = value;
- }
-
- @Override public void putDecimal(int rowId, Decimal value, int precision) {
- decimals[rowId] = value;
- }
-
- @Override public void putDouble(int rowId, double value) {
- doubles[rowId] = value;
- }
-
- @Override public void putBytes(int rowId, byte[] value) {
- bytes[rowId] = value;
- }
-
- @Override public void putBytes(int rowId, int offset, int length, byte[] value) {
-
- }
-
- @Override public void putNull(int rowId) {
- nullBytes.set(rowId);
- }
-
- @Override public boolean isNull(int rowId) {
- return nullBytes.get(rowId);
- }
-
- @Override public void putObject(int rowId, Object obj) {
- data[rowId] = obj;
- }
-
- @Override public Object getData(int rowId) {
- if (nullBytes.get(rowId)) {
- return null;
- }
- switch (dataType) {
- case INT:
- return ints[rowId];
- case LONG:
- return longs[rowId];
- case DOUBLE:
- return doubles[rowId];
- case STRING:
- return UTF8String.fromBytes(bytes[rowId]);
- case DECIMAL:
- return decimals[rowId];
- default:
- return data[rowId];
- }
- }
-
- @Override public void reset() {
- nullBytes.clear();
- switch (dataType) {
- case INT:
- Arrays.fill(ints, 0);
- break;
- case LONG:
- Arrays.fill(longs, 0);
- break;
- case DOUBLE:
- Arrays.fill(doubles, 0);
- break;
- case STRING:
- Arrays.fill(bytes, null);
- break;
- case DECIMAL:
- Arrays.fill(decimals, null);
- break;
- default:
- Arrays.fill(data, null);
- }
- }
-}
[2/2] incubator-carbondata git commit: [CARBONDATA-741] Remove
useless classes This closes #636
Posted by he...@apache.org.
[CARBONDATA-741] Remove useless classes This closes #636
Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/f4f852e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/f4f852e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/f4f852e7
Branch: refs/heads/master
Commit: f4f852e78e77cd5f7c8042931bc4c5463bb284ea
Parents: 8fef247 d246dae
Author: hexiaoqiao <he...@meituan.com>
Authored: Thu Mar 9 21:31:33 2017 +0800
Committer: hexiaoqiao <he...@meituan.com>
Committed: Thu Mar 9 21:31:33 2017 +0800
----------------------------------------------------------------------
.../result/iterator/VectorChunkRowIterator.java | 91 -----------
.../vector/impl/CarbonColumnVectorImpl.java | 152 -------------------
2 files changed, 243 deletions(-)
----------------------------------------------------------------------