@@ -25,28 +25,40 @@ public class PreAnalyzerTests extends ESTestCase {
2525 private PreAnalyzer preAnalyzer = new PreAnalyzer ();
2626
2727 public void testBasicIndex () {
28- LogicalPlan plan = new UnresolvedRelation (EMPTY , new TableIdentifier (EMPTY , null , "index" ), null , false );
28+ LogicalPlan plan = new UnresolvedRelation (EMPTY , new TableIdentifier (EMPTY , null , "index" , null ), null , false );
2929 PreAnalysis result = preAnalyzer .preAnalyze (plan );
3030 assertThat (plan .preAnalyzed (), is (true ));
3131 assertThat (result .indices , hasSize (1 ));
3232 assertThat (result .indices .get (0 ).id ().cluster (), nullValue ());
3333 assertThat (result .indices .get (0 ).id ().index (), is ("index" ));
34+ assertThat (result .indices .get (0 ).id ().selector (), nullValue ());
3435 }
3536
3637 public void testBasicIndexWithCatalog () {
37- LogicalPlan plan = new UnresolvedRelation (EMPTY , new TableIdentifier (EMPTY , "elastic" , "index" ), null , false );
38+ LogicalPlan plan = new UnresolvedRelation (EMPTY , new TableIdentifier (EMPTY , "elastic" , "index" , null ), null , false );
3839 PreAnalysis result = preAnalyzer .preAnalyze (plan );
3940 assertThat (plan .preAnalyzed (), is (true ));
4041 assertThat (result .indices , hasSize (1 ));
4142 assertThat (result .indices .get (0 ).id ().cluster (), is ("elastic" ));
4243 assertThat (result .indices .get (0 ).id ().index (), is ("index" ));
44+ assertThat (result .indices .get (0 ).id ().selector (), nullValue ());
45+ }
46+
47+ public void testBasicIndexWithSelector () {
48+ LogicalPlan plan = new UnresolvedRelation (EMPTY , new TableIdentifier (EMPTY , null , "index" , "failures" ), null , false );
49+ PreAnalysis result = preAnalyzer .preAnalyze (plan );
50+ assertThat (plan .preAnalyzed (), is (true ));
51+ assertThat (result .indices , hasSize (1 ));
52+ assertThat (result .indices .get (0 ).id ().cluster (), nullValue ());
53+ assertThat (result .indices .get (0 ).id ().index (), is ("index" ));
54+ assertThat (result .indices .get (0 ).id ().selector (), is ("failures" ));
4355 }
4456
4557 public void testComplicatedQuery () {
4658 LogicalPlan plan = new Limit (
4759 EMPTY ,
4860 new Literal (EMPTY , 10 , INTEGER ),
49- new UnresolvedRelation (EMPTY , new TableIdentifier (EMPTY , null , "aaa" ), null , false )
61+ new UnresolvedRelation (EMPTY , new TableIdentifier (EMPTY , null , "aaa" , null ), null , false )
5062 );
5163 PreAnalysis result = preAnalyzer .preAnalyze (plan );
5264 assertThat (plan .preAnalyzed (), is (true ));
0 commit comments