Skip to content

Commit

Permalink
fix 4 code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
jt2594838 committed Mar 3, 2020
1 parent cb8ecb8 commit 623bfad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Expand Up @@ -44,6 +44,8 @@

public class BatchInsertPlan extends PhysicalPlan {

private static final String DATATYPE_UNSUPPORTED = "Data type %s is not supported.";

private String deviceId;
private String[] measurements;
private TSDataType[] dataTypes;
Expand Down Expand Up @@ -205,7 +207,7 @@ private void serializeColumn(TSDataType dataType, Object column, DataOutputStrea
break;
default:
throw new UnSupportedDataTypeException(
String.format("Data type %s is not supported.", dataType));
String.format(DATATYPE_UNSUPPORTED, dataType));
}
}

Expand Down Expand Up @@ -292,7 +294,7 @@ private void serializeColumn(TSDataType dataType, Object column, ByteBuffer buff
break;
default:
throw new UnSupportedDataTypeException(
String.format("Data type %s is not supported.", dataType));
String.format(DATATYPE_UNSUPPORTED, dataType));
}
}

Expand Down Expand Up @@ -436,7 +438,7 @@ public TimeValuePair composeLastTimeValuePair(int measurementIndex) {
break;
default:
throw new UnSupportedDataTypeException(
String.format("Data type %s is not supported.", dataTypes[measurementIndex]));
String.format(DATATYPE_UNSUPPORTED, dataTypes[measurementIndex]));
}
return new TimeValuePair(times[end - 1], value);
}
Expand Down
Expand Up @@ -132,7 +132,7 @@ private static TSExecuteStatementResp getExecuteResp(List<String> columns,
List<String> dataTypes, boolean ignoreTimeStamp) {
TSExecuteStatementResp resp =
TSServiceImpl.getTSExecuteStatementResp(TSServiceImpl.getStatus(TSStatusCode.SUCCESS_STATUS));
resp.setIgnoreTimeStamp(true);
resp.setIgnoreTimeStamp(ignoreTimeStamp);
resp.setColumns(columns);
resp.setDataTypeList(dataTypes);
return resp;
Expand Down
Expand Up @@ -18,9 +18,6 @@
*/
package org.apache.iotdb.db.service;

import static org.apache.iotdb.db.conf.IoTDBConstant.COLUMN_VALUE;
import static org.apache.iotdb.db.conf.IoTDBConstant.COLUMN_TIMESERIES;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.sql.SQLException;
Expand Down Expand Up @@ -62,7 +59,12 @@
import org.apache.iotdb.db.qp.executor.PlanExecutor;
import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.apache.iotdb.db.qp.physical.crud.*;
import org.apache.iotdb.db.qp.physical.crud.AlignByDevicePlan;
import org.apache.iotdb.db.qp.physical.crud.BatchInsertPlan;
import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
import org.apache.iotdb.db.qp.physical.crud.LastQueryPlan;
import org.apache.iotdb.db.qp.physical.crud.QueryPlan;
import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
import org.apache.iotdb.db.qp.physical.sys.CreateTimeSeriesPlan;
import org.apache.iotdb.db.qp.physical.sys.DeleteStorageGroupPlan;
Expand Down

0 comments on commit 623bfad

Please sign in to comment.