Skip to content

Commit f9deb4f

Browse files
committed
Pick up TimestampAware interface from main
1 parent 4cf5cc2 commit f9deb4f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/promql/PromqlLogicalPlanBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import org.elasticsearch.core.TimeValue;
1212
import org.elasticsearch.xpack.esql.core.expression.Expression;
1313
import org.elasticsearch.xpack.esql.core.expression.Literal;
14-
import org.elasticsearch.xpack.esql.core.expression.MetadataAttribute;
1514
import org.elasticsearch.xpack.esql.core.expression.UnresolvedAttribute;
15+
import org.elasticsearch.xpack.esql.core.expression.UnresolvedTimestamp;
1616
import org.elasticsearch.xpack.esql.core.tree.Node;
1717
import org.elasticsearch.xpack.esql.core.tree.Source;
1818
import org.elasticsearch.xpack.esql.core.type.DataType;
@@ -134,7 +134,7 @@ public LogicalPlan visitSelector(PromqlBaseParser.SelectorContext ctx) {
134134
final LabelMatchers matchers = new LabelMatchers(labels);
135135
final Evaluation finalEvaluation = evaluation;
136136

137-
UnresolvedAttribute timestamp = new UnresolvedAttribute(source, MetadataAttribute.TIMESTAMP_FIELD);
137+
UnresolvedTimestamp timestamp = new UnresolvedTimestamp(source);
138138

139139
return rangeEx == null
140140
? new InstantSelector(source, series, labelExpressions, matchers, finalEvaluation, timestamp)

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/promql/selector/Selector.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@
1212
import org.elasticsearch.xpack.esql.core.expression.Attribute;
1313
import org.elasticsearch.xpack.esql.core.expression.Expression;
1414
import org.elasticsearch.xpack.esql.core.tree.Source;
15+
import org.elasticsearch.xpack.esql.expression.function.TimestampAware;
1516
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan;
1617
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
1718
import org.elasticsearch.xpack.esql.plan.logical.promql.PlaceholderRelation;
1819

1920
import java.io.IOException;
21+
import java.sql.Time;
2022
import java.util.List;
2123
import java.util.Objects;
2224

2325
/**
2426
* Base class representing a PromQL vector selector.
2527
* A vector selector is defined by a set of label matchers and a point in time evaluation context.
2628
*/
27-
public abstract class Selector extends UnaryPlan {
29+
public abstract class Selector extends UnaryPlan implements TimestampAware {
2830
// implements TelemetryAware
2931

3032
// in Promql this is the __name__ label however for now, this gets mapped to an exact field

0 commit comments

Comments
 (0)