Skip to content

Commit

Permalink
Just use one index name
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaverner committed Dec 16, 2024
1 parent 701d589 commit d78b655
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ public static IndexResolution expandedDefaultIndexResolution() {
}

public static Map<String, IndexResolution> defaultLookupResolution() {
return Map.of(
"languages_lookup",
loadMapping("mapping-languages.json", "languages_lookup", IndexMode.LOOKUP),
"language_code",
loadMapping("mapping-languages.json", "language_code", IndexMode.LOOKUP)
);
return Map.of("languages_lookup", loadMapping("mapping-languages.json", "languages_lookup", IndexMode.LOOKUP));
}

public static EnrichResolution defaultEnrichResolution() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5908,15 +5908,15 @@ public void testLookupStats() {
* | \_Limit[1000[INTEGER]]
* | \_Filter[languages{f}#10 > 1[INTEGER]]
* | \_EsRelation[test][_meta_field{f}#13, emp_no{f}#7, first_name{f}#8, ge..]
* \_EsRelation[language_code][LOOKUP][language_code{f}#18, language_name{f}#19]
* \_EsRelation[languages_lookup][LOOKUP][language_code{f}#18, language_name{f}#19]
*/
public void testLookupJoinPushDownFilterOnJoinKeyWithRename() {
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V6.isEnabled());

String query = """
FROM test
| RENAME languages AS language_code
| LOOKUP JOIN language_code ON language_code
| LOOKUP JOIN languages_lookup ON language_code
| WHERE language_code > 1
""";
var plan = optimizedPlan(query);
Expand Down Expand Up @@ -5951,15 +5951,15 @@ public void testLookupJoinPushDownFilterOnJoinKeyWithRename() {
* | \_Limit[1000[INTEGER]]
* | \_Filter[emp_no{f}#7 > 1[INTEGER]]
* | \_EsRelation[test][_meta_field{f}#13, emp_no{f}#7, first_name{f}#8, ge..]
* \_EsRelation[language_code][LOOKUP][language_code{f}#18, language_name{f}#19]
* \_EsRelation[languages_lookup][LOOKUP][language_code{f}#18, language_name{f}#19]
*/
public void testLookupJoinPushDownFilterOnLeftSideField() {
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V6.isEnabled());

String query = """
FROM test
| RENAME languages AS language_code
| LOOKUP JOIN language_code ON language_code
| LOOKUP JOIN languages_lookup ON language_code
| WHERE emp_no > 1
""";

Expand Down Expand Up @@ -5995,15 +5995,15 @@ public void testLookupJoinPushDownFilterOnLeftSideField() {
* |_EsqlProject[[_meta_field{f}#13, emp_no{f}#7, first_name{f}#8, gender{f}#9, hire_date{f}#14, job{f}#15, job.raw{f}#16, lang
* uages{f}#10 AS language_code, last_name{f}#11, long_noidx{f}#17, salary{f}#12]]
* | \_EsRelation[test][_meta_field{f}#13, emp_no{f}#7, first_name{f}#8, ge..]
* \_EsRelation[language_code][LOOKUP][language_code{f}#18, language_name{f}#19]
* \_EsRelation[languages_lookup][LOOKUP][language_code{f}#18, language_name{f}#19]
*/
public void testLookupJoinPushDownDisabledForLookupField() {
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V6.isEnabled());

String query = """
FROM test
| RENAME languages AS language_code
| LOOKUP JOIN language_code ON language_code
| LOOKUP JOIN languages_lookup ON language_code
| WHERE language_name == "English"
""";

Expand Down Expand Up @@ -6040,15 +6040,15 @@ public void testLookupJoinPushDownDisabledForLookupField() {
* guages{f}#11 AS language_code, last_name{f}#12, long_noidx{f}#18, salary{f}#13]]
* | \_Filter[emp_no{f}#8 > 1[INTEGER]]
* | \_EsRelation[test][_meta_field{f}#14, emp_no{f}#8, first_name{f}#9, ge..]
* \_EsRelation[language_code][LOOKUP][language_code{f}#19, language_name{f}#20]
* \_EsRelation[languages_lookup][LOOKUP][language_code{f}#19, language_name{f}#20]
*/
public void testLookupJoinPushDownSeparatedForConjunctionBetweenLeftAndRightField() {
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V6.isEnabled());

String query = """
FROM test
| RENAME languages AS language_code
| LOOKUP JOIN language_code ON language_code
| LOOKUP JOIN languages_lookup ON language_code
| WHERE language_name == "English" AND emp_no > 1
""";

Expand Down Expand Up @@ -6093,15 +6093,15 @@ public void testLookupJoinPushDownSeparatedForConjunctionBetweenLeftAndRightFiel
* |_EsqlProject[[_meta_field{f}#14, emp_no{f}#8, first_name{f}#9, gender{f}#10, hire_date{f}#15, job{f}#16, job.raw{f}#17, lan
* guages{f}#11 AS language_code, last_name{f}#12, long_noidx{f}#18, salary{f}#13]]
* | \_EsRelation[test][_meta_field{f}#14, emp_no{f}#8, first_name{f}#9, ge..]
* \_EsRelation[language_code][LOOKUP][language_code{f}#19, language_name{f}#20]
* \_EsRelation[languages_lookup][LOOKUP][language_code{f}#19, language_name{f}#20]
*/
public void testLookupJoinPushDownDisabledForDisjunctionBetweenLeftAndRightField() {
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V6.isEnabled());

String query = """
FROM test
| RENAME languages AS language_code
| LOOKUP JOIN language_code ON language_code
| LOOKUP JOIN languages_lookup ON language_code
| WHERE language_name == "English" OR emp_no > 1
""";

Expand Down

0 comments on commit d78b655

Please sign in to comment.