@KuduClusterTestContext(kuduClusterBasedTest = true)
@Test
public void textPrepaprePlanForScanners() throws Exception
{

  // no predicates test
  initOperatorState();
  AbstractKuduPartitionScanner<UnitTestTablePojo, InputOperatorControlTuple> scanner =
      unitTestStepwiseScanInputOperator.getScanner();
  SQLToKuduPredicatesTranslator translator = new SQLToKuduPredicatesTranslator(
      "select introwkey as intColumn from unittests",
      new ArrayList<ColumnSchema>(columnDefs.values()));
  List<KuduPartitionScanAssignmentMeta> scansForThisQuery = scanner.preparePlanForScanners(translator);
  // No predicates and hence a full scan and 1-1 implies one partition for this attempt
  assertEquals(1,scansForThisQuery.size());
  // many to one partitioner and no predicates
  numberOfKuduInputOperatorPartitions = 4;
  partitonScanStrategy = KuduPartitionScanStrategy.MANY_TABLETS_PER_OPERATOR;
  initOperatorState();
  translator = new SQLToKuduPredicatesTranslator(
    "select introwkey as intColumn from unittests",
    new ArrayList<ColumnSchema>(columnDefs.values()));
  scanner = unitTestStepwiseScanInputOperator.getScanner();
  scansForThisQuery = scanner.preparePlanForScanners(translator);
  assertEquals(3,scansForThisQuery.size()); // 12 kudu partitions over 4 Apex partitions = 3
  // many to one partitioner and no predicates
  numberOfKuduInputOperatorPartitions = 4;
  partitonScanStrategy = KuduPartitionScanStrategy.MANY_TABLETS_PER_OPERATOR;
  initOperatorState();
  translator = new SQLToKuduPredicatesTranslator(
    "select introwkey as intColumn from unittests where introwkey = 1",
    new ArrayList<ColumnSchema>(columnDefs.values()));
  scanner = unitTestStepwiseScanInputOperator.getScanner();
  scansForThisQuery = scanner.preparePlanForScanners(translator);
  // This query will actually result in two tablet scans as there is a hash partition involved as well apart from
  // range partitioning. However this operator is getting one scan as part of the pie assignment. Hence assert 1
  assertEquals(1,scansForThisQuery.size());
  //revert all changes back for subsequent tests
  numberOfKuduInputOperatorPartitions = 5;
  partitonScanStrategy = KuduPartitionScanStrategy.ONE_TABLET_PER_OPERATOR;
}