提交 1e1e9473 编写于 作者: H Haojun Liao

[TD-225]

上级 71fe2885
...@@ -89,7 +89,7 @@ public class TSDBDriver extends AbstractTaosDriver { ...@@ -89,7 +89,7 @@ public class TSDBDriver extends AbstractTaosDriver {
/** /**
* fetch data from native function in a batch model * fetch data from native function in a batch model
*/ */
public static final String PROPERTY_KEY_BATCH_LOAD = "batch"; public static final String PROPERTY_KEY_BATCH_LOAD = "batchfetch";
private TSDBDatabaseMetaData dbMetaData = null; private TSDBDatabaseMetaData dbMetaData = null;
......
...@@ -31,8 +31,6 @@ import java.util.List; ...@@ -31,8 +31,6 @@ import java.util.List;
public class TSDBResultSetBlockData { public class TSDBResultSetBlockData {
private int numOfRows = 0; private int numOfRows = 0;
private int numOfCols = 0;
private int rowIndex = 0; private int rowIndex = 0;
private List<ColumnMetaData> columnMetaDataList; private List<ColumnMetaData> columnMetaDataList;
...@@ -40,22 +38,20 @@ public class TSDBResultSetBlockData { ...@@ -40,22 +38,20 @@ public class TSDBResultSetBlockData {
public TSDBResultSetBlockData(List<ColumnMetaData> colMeta, int numOfCols) { public TSDBResultSetBlockData(List<ColumnMetaData> colMeta, int numOfCols) {
this.columnMetaDataList = colMeta; this.columnMetaDataList = colMeta;
this.setNumOfCols(numOfCols); this.colData = new ArrayList<Object>(numOfCols);
} }
public TSDBResultSetBlockData() { public TSDBResultSetBlockData() {
this.colData = new ArrayList<Object>(); this.colData = new ArrayList<Object>();
this.setNumOfCols(0);
} }
public void clear() { public void clear() {
int size = this.colData.size();
if (this.colData != null) { if (this.colData != null) {
this.colData.clear(); this.colData.clear();
} }
if (this.numOfCols == 0) { setNumOfCols(size);
return;
}
} }
public int getNumOfRows() { public int getNumOfRows() {
...@@ -67,12 +63,12 @@ public class TSDBResultSetBlockData { ...@@ -67,12 +63,12 @@ public class TSDBResultSetBlockData {
} }
public int getNumOfCols() { public int getNumOfCols() {
return numOfCols; return this.colData.size();
} }
public void setNumOfCols(int numOfCols) { public void setNumOfCols(int numOfCols) {
this.numOfCols = numOfCols; this.colData = new ArrayList<Object>(numOfCols);
this.clear(); this.colData.addAll(Collections.nCopies(numOfCols, null));
} }
public boolean hasMore() { public boolean hasMore() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册