|
9 | 9 |
|
10 | 10 | import org.elasticsearch.common.Strings; |
11 | 11 | import org.elasticsearch.common.VersionId; |
| 12 | +import org.elasticsearch.core.UpdateForV9; |
| 13 | +import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvAvg; |
12 | 14 |
|
13 | 15 | import java.util.Arrays; |
14 | 16 | import java.util.Comparator; |
15 | 17 | import java.util.LinkedHashMap; |
16 | 18 | import java.util.Map; |
17 | 19 |
|
| 20 | +/** |
| 21 | + * The version of the ESQL language being processed. |
| 22 | + * <p> |
| 23 | + * ESQL is a young language and we don't have the benefit of self-hosting |
| 24 | + * its compiler. So we're going to make a lot of mistakes when designing it. |
| 25 | + * As such, we expect it to change in backwards incompatible ways several |
| 26 | + * times in 2024 and 2025. Hopefully we'll have learned our lesson and we'll |
| 27 | + * settle down to one change every couple of years after that. |
| 28 | + * </p> |
| 29 | + * <p> |
| 30 | + * For example, maybe we realize we've made a mistake with the {@link MvAvg} |
| 31 | + * function and decide it should return the type of its input field rather |
| 32 | + * than always returning a {@code double}. If we decide to make this change |
| 33 | + * we'd have to bump the language version. We plan to batch changes like this |
| 34 | + * into the {@link EsqlVersion#SNAPSHOT} version for a while and from time to |
| 35 | + * time release them as a new version. |
| 36 | + * </p> |
| 37 | + * <p> |
| 38 | + * We require a version to be sent on every request to the ESQL APIs so |
| 39 | + * changing the version of a query is always opt-in. There is no REST request |
| 40 | + * you can send to any ESQL endpoint that will default to a version of ESQL. |
| 41 | + * That means we can release new versions of ESQL in a minor release of |
| 42 | + * Elasticsearch. We can and we will. |
| 43 | + * </p> |
| 44 | + * <p> |
| 45 | + * So users of Elasticsearch's clients don't need to think about the version |
| 46 | + * of ESQL when they are getting started they we have a concept of "base version". |
| 47 | + * This "base version" will remain constant for an entire major release of |
| 48 | + * Elasticsearch and clients will send that version with ESQL requests unless |
| 49 | + * otherwise configured. |
| 50 | + * </p> |
| 51 | + * <p> |
| 52 | + * This is marked with {@link UpdateForV9} to remind us that we need to |
| 53 | + * update the "base version" of ESQL in the client specification when |
| 54 | + * we cut a new major. We'll need to do that on every major - and also bump the {@link UpdateForV9} annotation. |
| 55 | + * </p> |
| 56 | + */ |
18 | 57 | public enum EsqlVersion implements VersionId<EsqlVersion> { |
19 | 58 | /** |
20 | 59 | * Breaking changes go here until the next version is released. |
|
0 commit comments