mirror of https://github.com/apache/druid.git
SubstringDimExtractionFn, BoundDimFilter: Implement typical style toString. (#3658)
This commit is contained in:
parent
2bbbad9908
commit
4cbebd0931
|
@ -130,4 +130,10 @@ public class SubstringDimExtractionFn extends DimExtractionFn
|
|||
result = 31 * result + end;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("substring(%s, %s)", index, getLength());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,6 +276,42 @@ public class BoundDimFilter implements DimFilter
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
if (lower != null) {
|
||||
builder.append(lower);
|
||||
if (lowerStrict) {
|
||||
builder.append(" < ");
|
||||
} else {
|
||||
builder.append(" <= ");
|
||||
}
|
||||
}
|
||||
|
||||
if (extractionFn != null) {
|
||||
builder.append(String.format("%s(%s)", extractionFn, dimension));
|
||||
} else {
|
||||
builder.append(dimension);
|
||||
}
|
||||
|
||||
if (!ordering.equals(StringComparators.LEXICOGRAPHIC)) {
|
||||
builder.append(String.format(" as %s", ordering.toString()));
|
||||
}
|
||||
|
||||
if (upper != null) {
|
||||
if (upperStrict) {
|
||||
builder.append(" < ");
|
||||
} else {
|
||||
builder.append(" <= ");
|
||||
}
|
||||
builder.append(upper);
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private Supplier<DruidLongPredicate> makeLongPredicateSupplier()
|
||||
{
|
||||
return new Supplier<DruidLongPredicate>()
|
||||
|
|
Loading…
Reference in New Issue