Search in sources :

Example 26 with PlanMapper

use of org.apache.hadoop.hive.ql.plan.mapper.PlanMapper in project hive by apache.

the class TestStatEstimations method testFilterStringNotIn.

// FIXME: right now not in is transformed into AND( NE(...) , NE(...) )
@Ignore
@Test
public void testFilterStringNotIn() throws CommandProcessorException {
    IDriver driver = createDriver();
    String query = "explain select a from t2 where b NOT IN ('XXX', 'UUU') order by a";
    PlanMapper pm = getMapperForQuery(driver, query);
    List<FilterOperator> fos = pm.getAll(FilterOperator.class);
    // the same operator is present 2 times
    fos.sort(TestCounterMapping.OPERATOR_ID_COMPARATOR.reversed());
    assertEquals(1, fos.size());
    FilterOperator fop = fos.get(0);
    // any estimation near 10 is ok...currently 10
    assertEquals(10, fop.getStatistics().getNumRows());
}
Also used : FilterOperator(org.apache.hadoop.hive.ql.exec.FilterOperator) PlanMapper(org.apache.hadoop.hive.ql.plan.mapper.PlanMapper) IDriver(org.apache.hadoop.hive.ql.IDriver) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

PlanMapper (org.apache.hadoop.hive.ql.plan.mapper.PlanMapper)26 IDriver (org.apache.hadoop.hive.ql.IDriver)17 Test (org.junit.Test)17 FilterOperator (org.apache.hadoop.hive.ql.exec.FilterOperator)12 OpTreeSignature (org.apache.hadoop.hive.ql.optimizer.signature.OpTreeSignature)5 OperatorStats (org.apache.hadoop.hive.ql.stats.OperatorStats)4 Statistics (org.apache.hadoop.hive.ql.plan.Statistics)3 EquivGroup (org.apache.hadoop.hive.ql.plan.mapper.PlanMapper.EquivGroup)3 HiveFilter (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveFilter)2 CommandProcessorResponse (org.apache.hadoop.hive.ql.processors.CommandProcessorResponse)2 Ignore (org.junit.Ignore)2 IOException (java.io.IOException)1 HiveConf (org.apache.hadoop.hive.conf.HiveConf)1 CommonJoinOperator (org.apache.hadoop.hive.ql.exec.CommonJoinOperator)1 ColStatistics (org.apache.hadoop.hive.ql.plan.ColStatistics)1 SimpleRuntimeStatsSource (org.apache.hadoop.hive.ql.plan.mapper.SimpleRuntimeStatsSource)1 StatsSource (org.apache.hadoop.hive.ql.plan.mapper.StatsSource)1 CommandProcessorException (org.apache.hadoop.hive.ql.processors.CommandProcessorException)1 ReExecDriver (org.apache.hadoop.hive.ql.reexec.ReExecDriver)1