public FillComponent parseFillClause(IoTDBSqlParser.FillClauseContext ctx) {
    FillComponent fillComponent = new FillComponent();
    if (ctx.LINEAR() != null) {
      fillComponent.setFillPolicy(FillPolicy.LINEAR);
    } else if (ctx.PREVIOUS() != null) {
      fillComponent.setFillPolicy(FillPolicy.PREVIOUS);

    } else if (ctx.constant() != null) {
      fillComponent.setFillPolicy(FillPolicy.CONSTANT);
      Literal fillValue = parseLiteral(ctx.constant());
      fillComponent.setFillValue(fillValue);
    } else {
      throw new SemanticException("Unknown FILL type.");
    }
    if (ctx.interval != null) {
      if (fillComponent.getFillPolicy() != FillPolicy.PREVIOUS) {
        throw new SemanticException(
            "Only FILL(PREVIOUS) support specifying the time duration threshold.");
      }
      fillComponent.setTimeDurationThreshold(
          DateTimeUtils.constructTimeDuration(ctx.interval.getText()));
    }
    return fillComponent;
  }
Parse time range (startTime and endTime) in group by time.

@throws SemanticException if startTime is larger or equals to endTime in timeRange
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java