Skip to content

Commit

Permalink
Refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
astefan committed Sep 13, 2024
1 parent f253412 commit 80f86fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
import java.util.Locale;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.xpack.esql.EsqlTestUtils.randomLiteral;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.sameInstance;
Expand All @@ -38,7 +41,7 @@ public class CaseTests extends AbstractScalarFunctionTestCase {

private static final List<DataType> TYPES;
static {
List<DataType> t = List.of(
List<DataType> t = Stream.of(
DataType.KEYWORD,
DataType.TEXT,
DataType.BOOLEAN,
Expand All @@ -54,11 +57,11 @@ public class CaseTests extends AbstractScalarFunctionTestCase {
DataType.CARTESIAN_SHAPE,
DataType.GEO_SHAPE,
DataType.NULL
);
).collect(Collectors.toList());
if (Build.current().isSnapshot()) {
t.add(DataType.DATE_NANOS);
t.addAll(DataType.UNDER_CONSTRUCTION.keySet());
}
TYPES = new ArrayList<>(t);
TYPES = unmodifiableList(t);
}

public CaseTests(@Name("TestCase") Supplier<TestCaseSupplier.TestCase> testCaseSupplier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;

import org.elasticsearch.Build;
import org.elasticsearch.common.Strings;
import org.elasticsearch.compute.data.Page;
import org.elasticsearch.core.PathUtils;
Expand Down Expand Up @@ -665,7 +666,10 @@ public static String randomGrokPattern() {
);
}

static List<DataType> DATA_TYPES = DataType.types().stream().toList();
static List<DataType> DATA_TYPES = DataType.types()
.stream()
.filter(d -> DataType.UNDER_CONSTRUCTION.containsKey(d) == false || Build.current().isSnapshot())
.toList();

static EsQueryExec.FieldSort randomFieldSort() {
return new EsQueryExec.FieldSort(
Expand Down

0 comments on commit 80f86fa

Please sign in to comment.