|
134 | 134 | import static java.util.Collections.emptyList; |
135 | 135 | import static java.util.Collections.singletonList; |
136 | 136 | 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; |
137 | 138 | import static org.elasticsearch.xpack.esql.core.type.DataType.BOOLEAN; |
138 | 139 | import static org.elasticsearch.xpack.esql.core.type.DataType.DATETIME; |
139 | 140 | import static org.elasticsearch.xpack.esql.core.type.DataType.DATE_NANOS; |
@@ -1819,10 +1820,6 @@ private static boolean canConvertOriginalTypes(MultiTypeEsField multiTypeEsField |
1819 | 1820 |
|
1820 | 1821 | private static Expression typeSpecificConvert(ConvertFunction convert, Source source, DataType type, InvalidMappedField mtf) { |
1821 | 1822 | 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) { |
1826 | 1823 | FieldAttribute originalFieldAttr = (FieldAttribute) convert.field(); |
1827 | 1824 | FieldAttribute resolvedAttr = new FieldAttribute( |
1828 | 1825 | source, |
@@ -1904,6 +1901,9 @@ private static LogicalPlan planWithoutSyntheticAttributes(LogicalPlan plan) { |
1904 | 1901 | private static class DateMillisToNanosInEsRelation extends Rule<LogicalPlan, LogicalPlan> { |
1905 | 1902 | @Override |
1906 | 1903 | public LogicalPlan apply(LogicalPlan plan) { |
| 1904 | + if (IMPLICIT_CASTING_DATE_AND_DATE_NANOS.isEnabled() == false) { |
| 1905 | + return plan; |
| 1906 | + } |
1907 | 1907 | return plan.transformUp(EsRelation.class, relation -> { |
1908 | 1908 | if (relation.indexMode() == IndexMode.LOOKUP) { |
1909 | 1909 | return relation; |
|
0 commit comments