Skip to content

Commit

Permalink
change default fill function to previous
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaojialin committed Mar 4, 2020
1 parent 5b8fd58 commit b508d4a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
Expand Up @@ -408,10 +408,10 @@ When the fill method is not specified, each data type bears its own default fill
|Data Type|Default Fill Methods and Parameters|
|:---|:---|
|boolean|previous, 600000|
|int32|linear, 600000, 600000|
|int64|linear, 600000, 600000|
|float|linear, 600000, 600000|
|double|linear, 600000, 600000|
|int32|previous, 600000|
|int64|previous, 600000|
|float|previous, 600000|
|double|previous, 600000|
|text|previous, 600000|
</center>

Expand Down
Expand Up @@ -71,20 +71,8 @@ public QueryDataSet execute(QueryContext context)
IFill fill;
long defaultFillInterval = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();
if (!typeIFillMap.containsKey(dataType)) {
switch (dataType) {
case INT32:
case INT64:
case FLOAT:
case DOUBLE:
fill = new LinearFill(dataType, queryTime, defaultFillInterval, defaultFillInterval);
break;
case BOOLEAN:
case TEXT:
fill = new PreviousFill(dataType, queryTime, defaultFillInterval);
break;
default:
throw new UnsupportedDataTypeException("do not support datatype " + dataType);
}
// the default fill function is PreviousFill for all data type
fill = new PreviousFill(dataType, queryTime, defaultFillInterval);
} else {
fill = typeIFillMap.get(dataType).copy();
}
Expand Down
Expand Up @@ -513,7 +513,7 @@ public void groupByTimeTest() throws ClassNotFoundException {
@Test
public void fillTest() throws ClassNotFoundException {
String[] retArray = new String[]{
"3,root.vehicle.d0,10000,40208,3.33,null,null,",
"3,root.vehicle.d0,10000,40000,3.33,null,null,",
"3,root.vehicle.d1,999,null,null,null,null,",
};

Expand Down

0 comments on commit b508d4a

Please sign in to comment.