Skip to content

Commit a3d2d84

Browse files
committed
Revert field name rename
1 parent 45ddff8 commit a3d2d84

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-all-types.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"byte" : {
1111
"type" : "byte"
1212
},
13-
"constant_keyword": {
13+
"constant_keyword-foo": {
1414
"type": "constant_keyword",
1515
"value": "foo"
1616
},

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ public void testOutOfRangeFilterPushdownWithFloatAndHalfFloat() {
787787
* Expects e.g.
788788
* LimitExec[1000[INTEGER]]
789789
* \_ExchangeExec[[],false]
790-
* \_ProjectExec[[!alias_integer, boolean{f}#190, byte{f}#191, constant_keyword{f}#192, date{f}#193, double{f}#194, ...]]
790+
* \_ProjectExec[[!alias_integer, boolean{f}#190, byte{f}#191, constant_keyword-foo{f}#192, date{f}#193, double{f}#194, ...]]
791791
* \_FieldExtractExec[!alias_integer, boolean{f}#190, byte{f}#191, consta..][]
792792
* \_EsQueryExec[test], query[{"esql_single_value":{"field":"byte","next":{"match_all":{"boost":1.0}},...}}]
793793
*/
@@ -2066,10 +2066,10 @@ public void testMultipleKnnQueriesInPrefilters() {
20662066

20672067
/**
20682068
* LimitExec[1000[INTEGER]]
2069-
* \_ExchangeExec[[!alias_integer, boolean{f}#415, byte{f}#416, constant_keyword{f}#417, date{f}#418, date_nanos{f}#419,
2069+
* \_ExchangeExec[[!alias_integer, boolean{f}#415, byte{f}#416, constant_keyword-foo{f}#417, date{f}#418, date_nanos{f}#419,
20702070
* double{f}#420, float{f}#421, half_float{f}#422, integer{f}#424, ip{f}#425, keyword{f}#426, long{f}#427, scaled_float{f}#423,
20712071
* !semantic_text, short{f}#429, text{f}#430, unsigned_long{f}#428, version{f}#431, wildcard{f}#432], false]
2072-
* \_ProjectExec[[!alias_integer, boolean{f}#415, byte{f}#416, constant_keyword{f}#417, date{f}#418, date_nanos{f}#419,
2072+
* \_ProjectExec[[!alias_integer, boolean{f}#415, byte{f}#416, constant_keyword-foo{f}#417, date{f}#418, date_nanos{f}#419,
20732073
* double{f}#420, float{f}#421, half_float{f}#422, integer{f}#424, ip{f}#425, keyword{f}#426, long{f}#427, scaled_float{f}#423,
20742074
* !semantic_text, short{f}#429, text{f}#430, unsigned_long{f}#428, version{f}#431, wildcard{f}#432]]
20752075
* \_FieldExtractExec[!alias_integer, boolean{f}#415, byte{f}#416, consta..]
@@ -2078,7 +2078,7 @@ public void testMultipleKnnQueriesInPrefilters() {
20782078
public void testConstantKeywordWithMatchingFilter() {
20792079
String queryText = """
20802080
from test
2081-
| where `constant_keyword` == "foo"
2081+
| where `constant_keyword-foo` == "foo"
20822082
""";
20832083
var analyzer = makeAnalyzer("mapping-all-types.json");
20842084
var plan = plannerOptimizer.plan(queryText, CONSTANT_K_STATS, analyzer);
@@ -2094,17 +2094,17 @@ public void testConstantKeywordWithMatchingFilter() {
20942094

20952095
/**
20962096
* LimitExec[1000[INTEGER]]
2097-
* \_ExchangeExec[[!alias_integer, boolean{f}#4, byte{f}#5, constant_keyword{f}#6, date{f}#7, date_nanos{f}#8, double{f}#9,
2097+
* \_ExchangeExec[[!alias_integer, boolean{f}#4, byte{f}#5, constant_keyword-foo{f}#6, date{f}#7, date_nanos{f}#8, double{f}#9,
20982098
* float{f}#10, half_float{f}#11, integer{f}#13, ip{f}#14, keyword{f}#15, long{f}#16, scaled_float{f}#12, !semantic_text,
20992099
* short{f}#18, text{f}#19, unsigned_long{f}#17, version{f}#20, wildcard{f}#21], false]
2100-
* \_LocalSourceExec[[!alias_integer, boolean{f}#4, byte{f}#5, constant_keyword{f}#6, date{f}#7, date_nanos{f}#8, double{f}#9,
2100+
* \_LocalSourceExec[[!alias_integer, boolean{f}#4, byte{f}#5, constant_keyword-foo{f}#6, date{f}#7, date_nanos{f}#8, double{f}#9,
21012101
* float{f}#10, half_float{f}#11, integer{f}#13, ip{f}#14, keyword{f}#15, long{f}#16, scaled_float{f}#12, !semantic_text,
21022102
* short{f}#18, text{f}#19, unsigned_long{f}#17, version{f}#20, wildcard{f}#21], EMPTY]
21032103
*/
21042104
public void testConstantKeywordWithNonMatchingFilter() {
21052105
String queryText = """
21062106
from test
2107-
| where `constant_keyword` == "non-matching"
2107+
| where `constant_keyword-foo` == "non-matching"
21082108
""";
21092109
var analyzer = makeAnalyzer("mapping-all-types.json");
21102110
var plan = plannerOptimizer.plan(queryText, CONSTANT_K_STATS, analyzer);
@@ -2116,20 +2116,20 @@ public void testConstantKeywordWithNonMatchingFilter() {
21162116

21172117
/**
21182118
* LimitExec[1000[INTEGER]]
2119-
* \_ExchangeExec[[!alias_integer, boolean{f}#6, byte{f}#7, constant_keyword{r}#25, date{f}#9, date_nanos{f}#10, double{f}#1...
2120-
* \_ProjectExec[[!alias_integer, boolean{f}#6, byte{f}#7, constant_keyword{r}#25, date{f}#9, date_nanos{f}#10, double{f}#1...
2119+
* \_ExchangeExec[[!alias_integer, boolean{f}#6, byte{f}#7, constant_keyword-foo{r}#25, date{f}#9, date_nanos{f}#10, double{f}#1...
2120+
* \_ProjectExec[[!alias_integer, boolean{f}#6, byte{f}#7, constant_keyword-foo{r}#25, date{f}#9, date_nanos{f}#10, double{f}#1...
21212121
* \_FieldExtractExec[!alias_integer, boolean{f}#6, byte{f}#7, date{f}#9,
21222122
* \_LimitExec[1000[INTEGER]]
2123-
* \_FilterExec[constant_keyword{r}#25 == [66 6f 6f][KEYWORD]]
2124-
* \_MvExpandExec[constant_keyword{f}#8,constant_keyword{r}#25]
2125-
* \_FieldExtractExec[constant_keyword{f}#8]
2123+
* \_FilterExec[constant_keyword-foo{r}#25 == [66 6f 6f][KEYWORD]]
2124+
* \_MvExpandExec[constant_keyword-foo{f}#8,constant_keyword-foo{r}#25]
2125+
* \_FieldExtractExec[constant_keyword-foo{f}#8]
21262126
* \_EsQueryExec[test], indexMode[standard], query[][_doc{f}#26], limit[], sort[] estimatedRowSize[412]
21272127
*/
21282128
public void testConstantKeywordExpandFilter() {
21292129
String queryText = """
21302130
from test
2131-
| mv_expand `constant_keyword`
2132-
| where `constant_keyword` == "foo"
2131+
| mv_expand `constant_keyword-foo`
2132+
| where `constant_keyword-foo` == "foo"
21332133
""";
21342134
var analyzer = makeAnalyzer("mapping-all-types.json");
21352135
var plan = plannerOptimizer.plan(queryText, CONSTANT_K_STATS, analyzer);
@@ -2146,18 +2146,18 @@ public void testConstantKeywordExpandFilter() {
21462146
}
21472147

21482148
/**
2149-
* DissectExec[constant_keyword{f}#8,Parser[pattern=%{bar}, appendSeparator=, ...
2149+
* DissectExec[constant_keyword-foo{f}#8,Parser[pattern=%{bar}, appendSeparator=, ...
21502150
* \_LimitExec[1000[INTEGER]]
2151-
* \_ExchangeExec[[!alias_integer, boolean{f}#6, byte{f}#7, constant_keyword{f}#8, date{f}#9, date_nanos{f}#10, double{f}#11...
2152-
* \_ProjectExec[[!alias_integer, boolean{f}#6, byte{f}#7, constant_keyword{f}#8, date{f}#9, date_nanos{f}#10, double{f}#11...
2151+
* \_ExchangeExec[[!alias_integer, boolean{f}#6, byte{f}#7, constant_keyword-foo{f}#8, date{f}#9, date_nanos{f}#10, double{f}#11...
2152+
* \_ProjectExec[[!alias_integer, boolean{f}#6, byte{f}#7, constant_keyword-foo{f}#8, date{f}#9, date_nanos{f}#10, double{f}#11...
21532153
* \_FieldExtractExec[!alias_integer, boolean{f}#6, byte{f}#7, constant_k..]
21542154
* \_EsQueryExec[test], indexMode[standard], query[][_doc{f}#25], limit[1000], sort[] estimatedRowSize[462]
21552155
*/
21562156
public void testConstantKeywordDissectFilter() {
21572157
String queryText = """
21582158
from test
2159-
| dissect `constant_keyword` "%{bar}"
2160-
| where `constant_keyword` == "foo"
2159+
| dissect `constant_keyword-foo` "%{bar}"
2160+
| where `constant_keyword-foo` == "foo"
21612161
""";
21622162
var analyzer = makeAnalyzer("mapping-all-types.json");
21632163
var plan = plannerOptimizer.plan(queryText, CONSTANT_K_STATS, analyzer);

0 commit comments

Comments
 (0)