Skip to content

Commit

Permalink
Instant Column gRPC Filters: Fix Range Quick Filters and use MatchFil…
Browse files Browse the repository at this point in the history
…ter over ConditionFilter (#5671)
  • Loading branch information
nbauernfeind authored Jun 26, 2024
1 parent 559d39e commit 98b62cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.deephaven.proto.backplane.grpc.NotCondition;
import io.deephaven.proto.backplane.grpc.Reference;
import io.deephaven.proto.backplane.grpc.Value;
import io.deephaven.time.DateTimeUtils;
import org.jetbrains.annotations.NotNull;

import java.text.DecimalFormat;
Expand Down Expand Up @@ -139,7 +138,7 @@ private WhereFilter generateNumericConditionFilter(CompareCondition.CompareOpera
valueString = Long.toString(value.getLongValue());
break;
case NANO_TIME_VALUE:
valueString = Long.toString(value.getNanoTimeValue());
valueString = String.format("'%d'", value.getNanoTimeValue());
break;
case VALUE_NOT_SET:
default:
Expand Down Expand Up @@ -184,8 +183,7 @@ public WhereFilter onIn(Value target, List<Value> candidatesList, CaseSensitivit
Literal literal = d.getLiteral();
// all other literals get created from a toString except DateTime
if (literal.getValueCase() == Literal.ValueCase.NANO_TIME_VALUE) {
values[i] = "'" + DateTimeUtils.formatDateTime(
DateTimeUtils.epochNanosToInstant(literal.getNanoTimeValue()), DateTimeUtils.timeZone()) + "'";
values[i] = String.format("'%d'", literal.getNanoTimeValue());
} else {
values[i] = FilterPrinter.printNoEscape(literal);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private void onLiteral(Literal literal) {
sb.append(literal.getLongValue());
break;
case NANO_TIME_VALUE:
sb.append("DateTimeUtils.epochNanosToInstant(").append(literal.getNanoTimeValue()).append(")");
sb.append("'").append(literal.getNanoTimeValue()).append("'");
break;
case VALUE_NOT_SET:
default:
Expand Down

0 comments on commit 98b62cb

Please sign in to comment.