mirror of https://github.com/apache/druid.git
allow sql lookup function to take advantage of injective lookups (#7655)
This commit is contained in:
parent
080270283a
commit
12a1ecfc2b
|
@ -41,8 +41,8 @@ public class LookupExtractionFn extends FunctionalExtraction
|
|||
@JsonProperty("lookup") final LookupExtractor lookup,
|
||||
@JsonProperty("retainMissingValue") final boolean retainMissingValue,
|
||||
@Nullable @JsonProperty("replaceMissingValueWith") final String replaceMissingValueWith,
|
||||
@JsonProperty("injective") final Boolean injective,
|
||||
@JsonProperty("optimize") final Boolean optimize
|
||||
@Nullable @JsonProperty("injective") final Boolean injective,
|
||||
@Nullable @JsonProperty("optimize") final Boolean optimize
|
||||
)
|
||||
{
|
||||
super(
|
||||
|
|
|
@ -48,7 +48,7 @@ public class RegisteredLookupExtractionFn implements ExtractionFn
|
|||
@JsonProperty("lookup") String lookup,
|
||||
@JsonProperty("retainMissingValue") final boolean retainMissingValue,
|
||||
@Nullable @JsonProperty("replaceMissingValueWith") final String replaceMissingValueWith,
|
||||
@JsonProperty("injective") final Boolean injective,
|
||||
@Nullable @JsonProperty("injective") final Boolean injective,
|
||||
@JsonProperty("optimize") Boolean optimize
|
||||
)
|
||||
{
|
||||
|
@ -73,12 +73,14 @@ public class RegisteredLookupExtractionFn implements ExtractionFn
|
|||
return retainMissingValue;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@JsonProperty("replaceMissingValueWith")
|
||||
public String getReplaceMissingValueWith()
|
||||
{
|
||||
return replaceMissingValueWith;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@JsonProperty("injective")
|
||||
public Boolean isInjective()
|
||||
{
|
||||
|
@ -151,10 +153,10 @@ public class RegisteredLookupExtractionFn implements ExtractionFn
|
|||
|
||||
delegate = new LookupExtractionFn(
|
||||
factory,
|
||||
isRetainMissingValue(),
|
||||
getReplaceMissingValueWith(),
|
||||
injective == null ? factory.isOneToOne() : injective,
|
||||
isOptimize()
|
||||
retainMissingValue,
|
||||
replaceMissingValueWith,
|
||||
injective,
|
||||
optimize
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class QueryLookupOperatorConversion implements SqlOperatorConversion
|
|||
(String) lookupNameExpr.getLiteralValue(),
|
||||
false,
|
||||
null,
|
||||
false,
|
||||
null,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5887,7 +5887,7 @@ public class CalciteQueryTest extends BaseCalciteQueryTest
|
|||
"lookyloo",
|
||||
false,
|
||||
null,
|
||||
false,
|
||||
null,
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -5940,7 +5940,7 @@ public class CalciteQueryTest extends BaseCalciteQueryTest
|
|||
"lookyloo",
|
||||
false,
|
||||
null,
|
||||
false,
|
||||
null,
|
||||
true
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue