Skip to content

Commit

Permalink
Cover range(DATE)->DATETIME case
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaverner committed Nov 8, 2024
1 parent 7cd46a0 commit d1aa099
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@ public DataType noText() {
return isString(this) ? KEYWORD : this;
}

public boolean isDate() {
return switch (this) {
case DATETIME, DATE_NANOS -> true;
default -> false;
};
}

/**
* Named parameters with default values. It's just easier to do this with
* a builder in java....
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ private static boolean rangeTypesCompatible(RangeType rangeType, DataType inputD
return switch (rangeType) {
case INTEGER, LONG -> inputDataType.isWholeNumber();
case IP -> inputDataType == DataType.IP;
case DATE -> inputDataType.isDate();
default -> rangeType.isNumeric() == inputDataType.isNumeric();
};
}
Expand Down

0 comments on commit d1aa099

Please sign in to comment.