use of org.apache.druid.segment.join.JoinMatcher in project druid by druid-io.
the class IndexedTableJoinableTest method makeJoinMatcherWithDimensionSelectorOnString.
@Test
public void makeJoinMatcherWithDimensionSelectorOnString() {
final JoinConditionAnalysis condition = JoinConditionAnalysis.forExpression("x == \"j.str\"", PREFIX, ExprMacroTable.nil());
final JoinMatcher joinMatcher = target.makeJoinMatcher(dummyColumnSelectorFactory, condition, false, false, Closer.create());
final DimensionSelector selector = joinMatcher.getColumnSelectorFactory().makeDimensionSelector(DefaultDimensionSpec.of("str"));
// getValueCardinality
Assert.assertEquals(4, selector.getValueCardinality());
// nameLookupPossibleInAdvance
Assert.assertTrue(selector.nameLookupPossibleInAdvance());
// lookupName
Assert.assertEquals("foo", selector.lookupName(0));
Assert.assertEquals("bar", selector.lookupName(1));
Assert.assertEquals("baz", selector.lookupName(2));
Assert.assertNull(selector.lookupName(3));
// lookupId
Assert.assertNull(selector.idLookup());
}
Aggregations