Skip to content

Commit a57929e

Browse files
committed
ES|QL: Polish the code.
Polish the TBUCKET related code.
1 parent de606d1 commit a57929e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ public enum Cap {
13401340
/**
13411341
* Support for tbucket function
13421342
*/
1343-
TBUCKET();
1343+
TBUCKET;
13441344

13451345
private final boolean enabled;
13461346

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,6 +2521,11 @@ public void testInvalidTBucketCalls() {
25212521
error("from test | stats max(event_duration) by tbucket(\"1\")", sampleDataAnalyzer),
25222522
equalTo("1:42: argument of [tbucket(\"1\")] must be [date_period or time_duration], found value [\"1\"] type [keyword]")
25232523
);
2524+
2525+
/*
2526+
To test unsupported @timestamp data type. In this case, we use a boolean as a type for the @timestamp field which is not supported
2527+
by TBUCKET.
2528+
*/
25242529
assertThat(
25252530
error("from test | stats max(event_duration) by tbucket(\"1 hour\")", oddSampleDataAnalyzer),
25262531
equalTo(

0 commit comments

Comments
 (0)