Skip to content

Commit f865774

Browse files
put date date_nanos implicit casting rule behind snapshot
1 parent 126e8cc commit f865774

File tree

1 file changed

+4
-4
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis

1 file changed

+4
-4
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
import static java.util.Collections.emptyList;
135135
import static java.util.Collections.singletonList;
136136
import static org.elasticsearch.xpack.core.enrich.EnrichPolicy.GEO_MATCH_TYPE;
137+
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.IMPLICIT_CASTING_DATE_AND_DATE_NANOS;
137138
import static org.elasticsearch.xpack.esql.core.type.DataType.BOOLEAN;
138139
import static org.elasticsearch.xpack.esql.core.type.DataType.DATETIME;
139140
import static org.elasticsearch.xpack.esql.core.type.DataType.DATE_NANOS;
@@ -1819,10 +1820,6 @@ private static boolean canConvertOriginalTypes(MultiTypeEsField multiTypeEsField
18191820

18201821
private static Expression typeSpecificConvert(ConvertFunction convert, Source source, DataType type, InvalidMappedField mtf) {
18211822
EsField field = new EsField(mtf.getName(), type, mtf.getProperties(), mtf.isAggregatable());
1822-
return typeSpecificConvert(convert, source, field);
1823-
}
1824-
1825-
private static Expression typeSpecificConvert(ConvertFunction convert, Source source, EsField field) {
18261823
FieldAttribute originalFieldAttr = (FieldAttribute) convert.field();
18271824
FieldAttribute resolvedAttr = new FieldAttribute(
18281825
source,
@@ -1904,6 +1901,9 @@ private static LogicalPlan planWithoutSyntheticAttributes(LogicalPlan plan) {
19041901
private static class DateMillisToNanosInEsRelation extends Rule<LogicalPlan, LogicalPlan> {
19051902
@Override
19061903
public LogicalPlan apply(LogicalPlan plan) {
1904+
if (IMPLICIT_CASTING_DATE_AND_DATE_NANOS.isEnabled() == false) {
1905+
return plan;
1906+
}
19071907
return plan.transformUp(EsRelation.class, relation -> {
19081908
if (relation.indexMode() == IndexMode.LOOKUP) {
19091909
return relation;

0 commit comments

Comments
 (0)