mirror of
https://github.com/apache/druid.git
synced 2025-02-25 20:48:05 +00:00
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;
|
result = 31 * result + end;
|
||||||
return result;
|
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;
|
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()
|
private Supplier<DruidLongPredicate> makeLongPredicateSupplier()
|
||||||
{
|
{
|
||||||
return new Supplier<DruidLongPredicate>()
|
return new Supplier<DruidLongPredicate>()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user