Examples of DataSourceComponent


Examples of plan_runner.components.DataSourceComponent

    @Test
    public void testHyracksManual() {
        String parserConfPath = CONF_PATH + "0_1G_hyracks_ncl";
        NameCompGen ncg = createCG(parserConfPath);
       
        DataSourceComponent customerSource = ncg.generateDataSource("CUSTOMER");
        DataSourceComponent ordersSource = ncg.generateDataSource("ORDERS");
        ncg.generateEquiJoin(customerSource, ordersSource);

        String planStr = ParserUtil.toString(ncg.getQueryPlan());
        //LOG.info(planStr);
       
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

    @Test
    public void testTPCH3Manual() {
        String parserConfPath = CONF_PATH + "0_1G_tpch3_ncl";
        NameCompGen ncg = createCG(parserConfPath);
       
        DataSourceComponent customerSource = ncg.generateDataSource("CUSTOMER");
        DataSourceComponent ordersSource = ncg.generateDataSource("ORDERS");
        Component C_Ojoin = ncg.generateEquiJoin(customerSource, ordersSource);
        DataSourceComponent lineitemSource = ncg.generateDataSource("LINEITEM");
        ncg.generateEquiJoin(C_Ojoin, lineitemSource);
       
        String planStr = ParserUtil.toString(ncg.getQueryPlan());
        //LOG.info(planStr);
       
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

         * R-N-S-L-O-C (this) : 33sec local mode, 51 nodes
         * R-N-S-C-O-L        : 48sec local mode, 83 nodes
         * R-N-S-L-C-O        : never finish, timeout problem, 3783 nodes
         * rule bushy plan    : 51sec local mode, even less total parallelism used
         */
        DataSourceComponent regionSource = ncg.generateDataSource("REGION");
        DataSourceComponent nationSource = ncg.generateDataSource("NATION");
        Component R_Njoin = ncg.generateEquiJoin(regionSource, nationSource);
        DataSourceComponent supplierSource = ncg.generateDataSource("SUPPLIER");
        Component R_N_Sjoin = ncg.generateEquiJoin(R_Njoin, supplierSource);
        DataSourceComponent lineitemSource = ncg.generateDataSource("LINEITEM");
        Component R_N_S_Ljoin = ncg.generateEquiJoin(R_N_Sjoin, lineitemSource);
        DataSourceComponent ordersSource = ncg.generateDataSource("ORDERS");
        Component R_N_S_L_Ojoin = ncg.generateEquiJoin(R_N_S_Ljoin, ordersSource);
        DataSourceComponent customerSource = ncg.generateDataSource("CUSTOMER");
        ncg.generateEquiJoin(R_N_S_L_Ojoin, customerSource);
       
        String planStr = ParserUtil.toString(ncg.getQueryPlan());
        //LOG.info(planStr);
       
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

  public HyracksPreAggPlan(String dataPath, String extension, Map conf) {
    // -------------------------------------------------------------------------------------
    // start of query plan filling
    final ProjectOperator projectionCustomer = new ProjectOperator(new int[] { 0, 6 });
    final List<Integer> hashCustomer = Arrays.asList(0);
    final DataSourceComponent relationCustomer = new DataSourceComponent("CUSTOMER", dataPath
        + "customer" + extension, _queryPlan).addOperator(projectionCustomer)
        .setHashIndexes(hashCustomer);

    // -------------------------------------------------------------------------------------
    final ProjectOperator projectionOrders = new ProjectOperator(new int[] { 1 });
    final List<Integer> hashOrders = Arrays.asList(0);
    final DataSourceComponent relationOrders = new DataSourceComponent("ORDERS", dataPath
        + "orders" + extension, _queryPlan).addOperator(projectionOrders).setHashIndexes(
        hashOrders);

    // -------------------------------------------------------------------------------------
    final ProjectOperator projFirstOut = new ProjectOperator(new ColumnReference(_sc, 1),
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

         * some numbers are not accurate anymore (PushingOr time is accurate)
         * S-N1-L-O-C-N2   : 35sec, 42nodes; PushingOr, 24sec, 24nodes
         * N2-C-O-L-S-N1   : 38sec, 68nodes
         * Rule lefty plan : 35sec
         */
        DataSourceComponent supplierSource = ncg.generateDataSource("SUPPLIER");
        DataSourceComponent n1Source = ncg.generateDataSource("N1");
        Component S_N1join = ncg.generateEquiJoin(supplierSource, n1Source);
        DataSourceComponent lineitemSource = ncg.generateDataSource("LINEITEM");
        Component S_N1_Ljoin = ncg.generateEquiJoin(S_N1join, lineitemSource);
        DataSourceComponent ordersSource = ncg.generateDataSource("ORDERS");
        Component S_N1_L_Ojoin = ncg.generateEquiJoin(S_N1_Ljoin, ordersSource);
        DataSourceComponent customerSource = ncg.generateDataSource("CUSTOMER");
        Component S_N1_L_O_Cjoin = ncg.generateEquiJoin(S_N1_L_Ojoin, customerSource);
        DataSourceComponent n2Source = ncg.generateDataSource("N2");
        ncg.generateEquiJoin(S_N1_L_O_Cjoin, n2Source);
       
        String planStr = ParserUtil.toString(ncg.getQueryPlan());
        //LOG.info(planStr);
       
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

         * R-N1-C-O-L-S-P-N2: 54nodes, 33sec
         * R-N1-C-O-L-S-N2-P: 62nodes, 34sec
         * P-L-S-N2-O-C-N1-R: cannot have parallelism more than one on the last level because of Regionkey
         * Manual bushy plan: 50sec
         */
        DataSourceComponent regionSource = ncg.generateDataSource("REGION");
        DataSourceComponent n1Source = ncg.generateDataSource("N1");
        Component R_N1join = ncg.generateEquiJoin(regionSource, n1Source);
        DataSourceComponent customerSource = ncg.generateDataSource("CUSTOMER");
        Component R_N1_Cjoin = ncg.generateEquiJoin(R_N1join, customerSource);
        DataSourceComponent ordersSource = ncg.generateDataSource("ORDERS");
        Component R_N1_C_Ojoin = ncg.generateEquiJoin(R_N1_Cjoin, ordersSource);
        DataSourceComponent lineitemSource = ncg.generateDataSource("LINEITEM");
        Component R_N1_C_O_Ljoin = ncg.generateEquiJoin(R_N1_C_Ojoin, lineitemSource);
        DataSourceComponent partSouce = ncg.generateDataSource("PART");
        Component R_N1_C_O_L_Pjoin = ncg.generateEquiJoin(R_N1_C_O_Ljoin, partSouce);
        DataSourceComponent supplierSource = ncg.generateDataSource("SUPPLIER");
        Component R_N1_C_O_L_P_Sjoin = ncg.generateEquiJoin(R_N1_C_O_L_Pjoin, supplierSource);
        DataSourceComponent n2Source = ncg.generateDataSource("N2");
        ncg.generateEquiJoin(R_N1_C_O_L_P_Sjoin, n2Source);
       
        String planStr = ParserUtil.toString(ncg.getQueryPlan());
        //LOG.info(planStr);
       
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

         * P-L-S-N-O-PS     : 61nodes, 41sec
         * P-L-S-N-PS-O     : 61nodes, 43sec
         * L-S-N-PS-P-0     : 107nodes, more than 200sec
         * Manual lefty plan: 37sec (parallelism everywhere 1)
         */
        DataSourceComponent partSource = ncg.generateDataSource("PART");
        DataSourceComponent lineitemSource = ncg.generateDataSource("LINEITEM");
        Component P_Ljoin = ncg.generateEquiJoin(partSource, lineitemSource);
        DataSourceComponent partSuppSource = ncg.generateDataSource("PARTSUPP");
        Component P_L_SPjoin = ncg.generateEquiJoin(P_Ljoin, partSuppSource);
        DataSourceComponent ordersSource = ncg.generateDataSource("ORDERS");
        Component P_L_SP_Ojoin = ncg.generateEquiJoin(P_L_SPjoin, ordersSource);
        DataSourceComponent supplierSource = ncg.generateDataSource("SUPPLIER");
        Component P_L_SP_O_Sjoin = ncg.generateEquiJoin(P_L_SP_Ojoin, supplierSource);
        DataSourceComponent nationSource = ncg.generateDataSource("NATION");
        ncg.generateEquiJoin(P_L_SP_O_Sjoin, nationSource);
       
        String planStr = ParserUtil.toString(ncg.getQueryPlan());
        //LOG.info(planStr);
       
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

         * L-O-C-N          : 34nodes, 23sec
         * C-O-N-L          : 35nodes, 23sec. might not work unless schema synonims are set
         * C-N-O-L          : 37nodes, 22sec , might not work unless schema synonims are set
         * Manual lefty plan: 22sec 
         */
        DataSourceComponent lineitemSource = ncg.generateDataSource("LINEITEM");
        DataSourceComponent ordersSource = ncg.generateDataSource("ORDERS");
        Component L_Ojoin = ncg.generateEquiJoin(lineitemSource, ordersSource);
        DataSourceComponent customerSource = ncg.generateDataSource("CUSTOMER");
        Component L_O_Cjoin = ncg.generateEquiJoin(L_Ojoin, customerSource);
        DataSourceComponent nationSource = ncg.generateDataSource("NATION");
        ncg.generateEquiJoin(L_O_Cjoin, nationSource);
       
        String planStr = ParserUtil.toString(ncg.getQueryPlan());
        //LOG.info(planStr);
       
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

    final SelectOperator selectionRegion = new SelectOperator(new ComparisonPredicate(
        new ColumnReference(_sc, 1), new ValueSpecification(_sc, _region)));

    final ProjectOperator projectionRegion = new ProjectOperator(new int[] { 0 });

    final DataSourceComponent relationRegion = new DataSourceComponent("REGION", dataPath
        + "region" + extension, _queryPlan).setHashIndexes(hashRegion)
        .addOperator(selectionRegion).addOperator(projectionRegion);

    // -------------------------------------------------------------------------------------
    final List<Integer> hashNation1 = Arrays.asList(1);

    final ProjectOperator projectionNation1 = new ProjectOperator(new int[] { 0, 2 });

    final DataSourceComponent relationNation1 = new DataSourceComponent("NATION1", dataPath
        + "nation" + extension, _queryPlan).setHashIndexes(hashNation1).addOperator(
        projectionNation1);

    // -------------------------------------------------------------------------------------
    final EquiJoinComponent R_Njoin = new EquiJoinComponent(relationRegion, relationNation1,
        _queryPlan).addOperator(new ProjectOperator(new int[] { 1 })).setHashIndexes(
        Arrays.asList(0));

    // -------------------------------------------------------------------------------------
    final List<Integer> hashCustomer = Arrays.asList(0);

    final ProjectOperator projectionCustomer = new ProjectOperator(new int[] { 3, 0 });

    final DataSourceComponent relationCustomer = new DataSourceComponent("CUSTOMER", dataPath
        + "customer" + extension, _queryPlan).setHashIndexes(hashCustomer).addOperator(
        projectionCustomer);

    // -------------------------------------------------------------------------------------
    final EquiJoinComponent R_N_Cjoin = new EquiJoinComponent(R_Njoin, relationCustomer,
        _queryPlan).addOperator(new ProjectOperator(new int[] { 1 })).setHashIndexes(
        Arrays.asList(0));

    // -------------------------------------------------------------------------------------
    final List<Integer> hashSupplier = Arrays.asList(1);

    final ProjectOperator projectionSupplier = new ProjectOperator(new int[] { 0, 3 });

    final DataSourceComponent relationSupplier = new DataSourceComponent("SUPPLIER", dataPath
        + "supplier" + extension, _queryPlan).setHashIndexes(hashSupplier).addOperator(
        projectionSupplier);

    // -------------------------------------------------------------------------------------
    final List<Integer> hashNation2 = Arrays.asList(0);

    final ProjectOperator projectionNation2 = new ProjectOperator(new int[] { 0, 1 });

    final DataSourceComponent relationNation2 = new DataSourceComponent("NATION2", dataPath
        + "nation" + extension, _queryPlan).setHashIndexes(hashNation2).addOperator(
        projectionNation2);

    // -------------------------------------------------------------------------------------
    final EquiJoinComponent S_Njoin = new EquiJoinComponent(relationSupplier, relationNation2,
        _queryPlan).addOperator(new ProjectOperator(new int[] { 0, 2 })).setHashIndexes(
        Arrays.asList(0));

    // -------------------------------------------------------------------------------------
    final List<Integer> hashPart = Arrays.asList(0);

    final SelectOperator selectionPart = new SelectOperator(new ComparisonPredicate(
        new ColumnReference(_sc, 4), new ValueSpecification(_sc, _type)));

    final ProjectOperator projectionPart = new ProjectOperator(new int[] { 0 });

    final DataSourceComponent relationPart = new DataSourceComponent("PART", dataPath + "part"
        + extension, _queryPlan).setHashIndexes(hashPart).addOperator(selectionPart)
        .addOperator(projectionPart);

    // -------------------------------------------------------------------------------------
    final List<Integer> hashLineitem = Arrays.asList(1);

    // first field in projection
    final ColumnReference orderKey = new ColumnReference(_sc, 0);
    // second field in projection
    final ColumnReference partKey = new ColumnReference(_sc, 1);
    // third field in projection
    final ColumnReference suppKey = new ColumnReference(_sc, 2);
    // forth field in projection
    final ValueExpression<Double> substract = new Subtraction(new ValueSpecification(
        _doubleConv, 1.0), new ColumnReference(_doubleConv, 6));
    // extendedPrice*(1-discount)
    final ValueExpression<Double> product = new Multiplication(new ColumnReference(_doubleConv,
        5), substract);
    final ProjectOperator projectionLineitem = new ProjectOperator(orderKey, partKey, suppKey,
        product);

    final DataSourceComponent relationLineitem = new DataSourceComponent("LINEITEM", dataPath
        + "lineitem" + extension, _queryPlan).setHashIndexes(hashLineitem).addOperator(
        projectionLineitem);

    // -------------------------------------------------------------------------------------
    final EquiJoinComponent P_Ljoin = new EquiJoinComponent(relationPart, relationLineitem,
        _queryPlan).addOperator(new ProjectOperator(new int[] { 1, 2, 3 })).setHashIndexes(
        Arrays.asList(0));

    // -------------------------------------------------------------------------------------
    final List<Integer> hashOrders = Arrays.asList(0);

    final SelectOperator selectionOrders = new SelectOperator(new BetweenPredicate(
        new ColumnReference(_dateConv, 4), true, new ValueSpecification(_dateConv, _date1),
        true, new ValueSpecification(_dateConv, _date2)));

    // first field in projection
    final ValueExpression OrdersOrderKey = new ColumnReference(_sc, 0);
    // second field in projection
    final ValueExpression OrdersCustKey = new ColumnReference(_sc, 1);
    // third field in projection
    final ValueExpression OrdersExtractYear = new IntegerYearFromDate(
        new ColumnReference<Date>(_dateConv, 4));
    final ProjectOperator projectionOrders = new ProjectOperator(OrdersOrderKey, OrdersCustKey,
        OrdersExtractYear);

    final DataSourceComponent relationOrders = new DataSourceComponent("ORDERS", dataPath
        + "orders" + extension, _queryPlan).setHashIndexes(hashOrders)
        .addOperator(selectionOrders).addOperator(projectionOrders);

    // -------------------------------------------------------------------------------------
    final EquiJoinComponent P_L_Ojoin = new EquiJoinComponent(P_Ljoin, relationOrders,
View Full Code Here

Examples of plan_runner.components.DataSourceComponent

  @Override
  public DataSourceComponent generateDataSource(String tableCompName) {
    final String tableSchemaName = _pq.getTan().getSchemaName(tableCompName);
    final String sourceFile = tableSchemaName.toLowerCase();

    final DataSourceComponent relation = new DataSourceComponent(tableCompName, _dataPath
        + sourceFile + _extension, _queryPlan);
    _subPlans.add(relation);
    return relation;
  }
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.