use of com.pingcap.tikv.types.DataType in project tispark by pingcap.
the class SchemaInferTest method selectAggWithGroupBySchemaInferTest.
@Test
public void selectAggWithGroupBySchemaInferTest() {
// select sum(number) from t1 group by name;
List<TiDAGRequest> dagRequests = makeSelectDAGReq(simpleGroupBy, complexGroupBy);
for (TiDAGRequest req : dagRequests) {
List<DataType> dataTypes = SchemaInfer.create(req).getTypes();
assertEquals(2, dataTypes.size());
assertEquals(IntegerType.BIGINT.getClass(), dataTypes.get(0).getClass());
assertEquals(IntegerType.BIGINT.getClass(), dataTypes.get(1).getClass());
}
}
use of com.pingcap.tikv.types.DataType in project tispark by pingcap.
the class SchemaInferTest method selectAggSchemaInferTest.
@Test
public void selectAggSchemaInferTest() {
// select sum(number) from t1;
TiDAGRequest tiDAGRequest = new TiDAGRequest(TiDAGRequest.PushDownType.NORMAL);
tiDAGRequest.addRequiredColumn(number);
tiDAGRequest.addAggregate(sum);
tiDAGRequest.setTableInfo(table);
tiDAGRequest.setStartTs(ts);
List<DataType> dataTypes = SchemaInfer.create(tiDAGRequest).getTypes();
assertEquals(1, dataTypes.size());
assertEquals(IntegerType.INT.getClass(), dataTypes.get(0).getClass());
}
Aggregations