mirror of https://github.com/apache/druid.git
fix Expressions.toQueryGranularity to be more correct, improve javadocs of Expr.getIdentifierIfIdentifier and Expr.getBindingIfIdentifier (#9363)
This commit is contained in:
parent
6d52edddab
commit
b1be88d79c
|
@ -80,7 +80,10 @@ public interface Expr
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the string identifier of an {@link IdentifierExpr}, else null
|
||||
* Returns the string identifier of an {@link IdentifierExpr}, else null. Use this method to analyze an {@link Expr}
|
||||
* tree when trying to distinguish between different {@link IdentifierExpr} with the same
|
||||
* {@link IdentifierExpr#binding}. Do NOT use this method to analyze the input binding (e.g. backing column name),
|
||||
* use {@link #getBindingIfIdentifier} instead.
|
||||
*/
|
||||
@Nullable
|
||||
default String getIdentifierIfIdentifier()
|
||||
|
@ -91,7 +94,7 @@ public interface Expr
|
|||
|
||||
/**
|
||||
* Returns the string key to use to get a value from {@link Expr.ObjectBinding} of an {@link IdentifierExpr},
|
||||
* else null
|
||||
* else null. Use this method to analyze the inputs required to an {@link Expr} tree (e.g. backing column name).
|
||||
*/
|
||||
@Nullable
|
||||
default String getBindingIfIdentifier()
|
||||
|
|
|
@ -703,7 +703,7 @@ public class Expressions
|
|||
final Expr arg = expr.getArg();
|
||||
final Granularity granularity = expr.getGranularity();
|
||||
|
||||
if (ColumnHolder.TIME_COLUMN_NAME.equals(arg.getIdentifierIfIdentifier())) {
|
||||
if (ColumnHolder.TIME_COLUMN_NAME.equals(arg.getBindingIfIdentifier())) {
|
||||
return granularity;
|
||||
} else {
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue