Examples of GroupScan


Examples of com.foundationdb.qp.memoryadapter.MemoryGroupCursor.GroupScan

    @Test
    public void viewsScan() {
        final Object[][] expected = {
                { null, "test", "voo", new Text("CREATE VIEW voo(c1,c2) AS SELECT c2,c1 FROM foo"), "NONE", false, "NO", "NO", "NO", "NO", LONG },
        };
        GroupScan scan = getFactory(BasicInfoSchemaTablesServiceImpl.VIEWS).getGroupScan(adapter);
        int skipped = scanAndCompare(expected, scan);
        assertEquals("Skip I_S views", 0, skipped);
    }
View Full Code Here

Examples of com.foundationdb.qp.memoryadapter.MemoryGroupCursor.GroupScan

    @Test
    public void viewTableUsageScan() {
        final Object[][] expected = {
                { null, "test", "voo", null, "test", "foo", LONG },
        };
        GroupScan scan = getFactory(BasicInfoSchemaTablesServiceImpl.VIEW_TABLE_USAGE).getGroupScan(adapter);
        int skipped = scanAndCompare(expected, scan);
        assertEquals("Skip I_S views", 0, skipped);
    }
View Full Code Here

Examples of com.foundationdb.qp.memoryadapter.MemoryGroupCursor.GroupScan

    public void viewColumnUsageScan() {
        final Object[][] expected = {
                { null, "test", "voo", null, "test", "foo", "c1", LONG },
                { null, "test", "voo", null, "test", "foo", "c2", LONG },
        };
        GroupScan scan = getFactory(BasicInfoSchemaTablesServiceImpl.VIEW_COLUMN_USAGE).getGroupScan(adapter);
        int skipped = scanAndCompare(expected, scan);
        assertEquals("Skip I_S views", 0, skipped);
    }
View Full Code Here

Examples of com.foundationdb.qp.memoryadapter.MemoryGroupCursor.GroupScan

        final Object[][] expected = {
            { null, "test", "proc1", null, "test", "proc1", "PROCEDURE", null, null, null, null, null, null, "EXTERNAL",
                null, "com.foundationdb.procs.Proc1.call", "java", "JAVA",
                "NO", null, null, null, "YES", 0L, null, null, null, null, false, null, null, null, LONG },
        };
        GroupScan scan = getFactory(BasicInfoSchemaTablesServiceImpl.ROUTINES).getGroupScan(adapter);
        int skipped = scanAndCompare(expected, scan);
        assertEquals("Skip I_S routines", 0, skipped);
    }
View Full Code Here

Examples of com.foundationdb.qp.memoryadapter.MemoryGroupCursor.GroupScan

            { null, "test", "proc1", "n1", 1L, "BIGINT", null, null, null, null, "IN", "NO", null, LONG },
            { null, "test", "proc1", "s1", 2L, "VARCHAR", 16L, null, null, null, "IN", "NO", null, LONG },
            { null, "test", "proc1", "n2", 3L, "DECIMAL", null, 10L, 10L, 5L, "IN", "NO", null, LONG },
            { null, "test", "proc1", null, 4L, "VARCHAR", 100L, null, null, null, "OUT", "NO", null, LONG },
        };
        GroupScan scan = getFactory(BasicInfoSchemaTablesServiceImpl.PARAMETERS).getGroupScan(adapter);
        int skipped = scanAndCompare(expected, scan);
        assertEquals("Skip I_S parameters", 0, skipped);
    }
View Full Code Here

Examples of com.foundationdb.qp.memoryadapter.MemoryGroupCursor.GroupScan

    @Test
    public void jarsScan() {
        final Object[][] expected = {
            { null, "test", "ajar", "https://example.com/procs/ajar.jar", LONG },
        };
        GroupScan scan = getFactory(BasicInfoSchemaTablesServiceImpl.JARS).getGroupScan(adapter);
        int skipped = scanAndCompare(expected, scan);
        assertEquals("Skip I_S jars", 0, skipped);
    }
View Full Code Here

Examples of com.foundationdb.qp.memoryadapter.MemoryGroupCursor.GroupScan

    @Test
    public void routineJarUsageScan() {
        final Object[][] expected = {
                { null, "test", "proc1", null, "test", "ajar", LONG },
        };
        GroupScan scan = getFactory(BasicInfoSchemaTablesServiceImpl.ROUTINE_JAR_USAGE).getGroupScan(adapter);
        int skipped = scanAndCompare(expected, scan);
        assertEquals("Skip I_S routines", 0, skipped);
    }
View Full Code Here

Examples of org.apache.drill.exec.physical.base.GroupScan

  }
  @Override
  public void onMatch(RelOptRuleCall call) {
    final DrillScanRel scan = (DrillScanRel) call.rel(0);

    GroupScan groupScan = scan.getGroupScan();

    DrillDistributionTrait partition = groupScan.getMaxParallelizationWidth() > 1 ? DrillDistributionTrait.RANDOM_DISTRIBUTED : DrillDistributionTrait.SINGLETON;

    final RelTraitSet traits = scan.getTraitSet().plus(Prel.DRILL_PHYSICAL).plus(partition);

    final DrillScanPrel newScan = ScanPrel.create(scan, traits, groupScan, scan.getRowType());
View Full Code Here

Examples of org.apache.drill.exec.physical.base.GroupScan

  public void onMatch(RelOptRuleCall call) {
    final DrillAggregateRel agg = (DrillAggregateRel) call.rel(0);
    final DrillScanRel scan = (DrillScanRel) call.rel(call.rels.length -1);
    final DrillProjectRel proj = call.rels.length == 3 ? (DrillProjectRel) call.rel(1) : null;

    GroupScan oldGrpScan = scan.getGroupScan();

    // Only apply the rule when :
    //    1) scan knows the exact row count in getSize() call,
    //    2) No GroupBY key,
    //    3) only one agg function (Check if it's count(*) below).
    //    4) No distinct agg call.
    if (! (oldGrpScan.getScanStats().getGroupScanProperty().hasExactRowCount()
        && agg.getGroupCount() == 0
        && agg.getAggCallList().size() == 1
        && !agg.containsDistinctCall())) {
      return;
    }

    AggregateCall aggCall = agg.getAggCallList().get(0);

    if (aggCall.getAggregation().getName().equals("COUNT") ) {

      long cnt = 0;
      //  count(*)  == >  empty arg  ==>  rowCount
      //  count(Not-null-input) ==> rowCount
      if (aggCall.getArgList().isEmpty() ||
          (aggCall.getArgList().size() == 1 &&
           ! agg.getChild().getRowType().getFieldList().get(aggCall.getArgList().get(0).intValue()).getType().isNullable())) {
        cnt = (long) oldGrpScan.getScanStats().getRecordCount();
      } else if (aggCall.getArgList().size() == 1) {
      // count(columnName) ==> Agg ( Scan )) ==> columnValueCount
        int index = aggCall.getArgList().get(0);
        String columnName = scan.getRowType().getFieldNames().get(index).toLowerCase();

        cnt = oldGrpScan.getColumnValueCount(SchemaPath.getSimplePath(columnName));
      } else {
        return; // do nothing.
      }

      RelDataType scanRowType = getCountDirectScanRowType(agg.getCluster().getTypeFactory());
View Full Code Here

Examples of org.apache.drill.exec.physical.base.GroupScan

  }
  @Override
  public void onMatch(RelOptRuleCall call) {
    final DrillScanRel scan = (DrillScanRel) call.rel(0);

    GroupScan groupScan = scan.getGroupScan();

    DrillDistributionTrait partition = groupScan.getMaxParallelizationWidth() > 1 ? DrillDistributionTrait.RANDOM_DISTRIBUTED : DrillDistributionTrait.SINGLETON;

    final RelTraitSet traits = scan.getTraitSet().plus(Prel.DRILL_PHYSICAL).plus(partition);

    final DrillScanPrel newScan = ScanPrel.create(scan, traits, groupScan, scan.getRowType());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.