Package sql.util

Examples of sql.util.TupleSchema


        inputTupleSchema.add(new ColumnNameType("LINEITEM.EXTENDEDPRICE * (1.0 - LINEITEM.DISCOUNT)", _dblConv));
        inputTupleSchema.add(new ColumnNameType("LINEITEM.ORDERKEY", _lc)); // not used
       
        DataSourceComponent source = new DataSourceComponent("TestFullExprs", "", new QueryPlan());
       
        NameSelectItemsVisitor selectVisitor = new NameSelectItemsVisitor(new TupleSchema(inputTupleSchema), _map, source);
        for(SelectItem elem: _pq.getSelectItems()){
            elem.accept(selectVisitor);
        }
        List<AggregateOperator> aggOps = selectVisitor.getAggOps();
        List<ValueExpression> groupByVEs = selectVisitor.getGroupByVEs();
View Full Code Here


  // Conditions are related only to parents of join,
  // but we have to filter who belongs to my branch in NameJoinHashVisitor.
  // We don't want to hash on something which will be used to join with same
  // later component in the hierarchy.
  private void addJoinHash(Component component, List<Expression> joinCondition) {
    final TupleSchema tupleSchema = _compCost.get(component.getName()).getSchema();
    final NameJoinHashVisitor joinOn = new NameJoinHashVisitor(tupleSchema, component);
    for (final Expression exp : joinCondition)
      exp.accept(joinOn);
    final List<ValueExpression> hashExpressions = joinOn.getExpressions();
View Full Code Here

  /*************************************************************************************
   * Project operator
   *************************************************************************************/
  private void addProjectOperator(Component component) {
    final String compName = component.getName();
    final TupleSchema inputTupleSchema = _compCost.get(compName).getSchema();
    final ProjSchemaCreator psc = new ProjSchemaCreator(_globalCollect, inputTupleSchema,
        component, _pq, _schema);
    psc.create();

    final TupleSchema outputTupleSchema = psc.getOutputSchema();

    if (!ParserUtil.isSameSchema(inputTupleSchema, outputTupleSchema)) {
      // no need to add projectOperator unless it changes something
      attachProjectOperator(component, psc.getProjectOperator());
      processProjectCost(component, outputTupleSchema);
View Full Code Here

    // create schema and selectivity wrt leftParent
    final String compName = joinComponent.getName();
    final CostParams costParams = new CostParams();

    // *********set schema
    final TupleSchema schema = ParserUtil.joinSchema(joinComponent.getParents(), _compCost);
    costParams.setSchema(schema);

    _compCost.put(compName, costParams);
  }
View Full Code Here

  private void createCompCost(OperatorComponent opComp) {
    final String compName = opComp.getName();
    final CostParams costParams = new CostParams();

    // *********set schema
    final TupleSchema schema = _compCost.get(opComp.getParents()[0].getName()).getSchema();
    costParams.setSchema(schema);

    _compCost.put(compName, costParams);
  }
View Full Code Here

  /*************************************************************************************
   * SELECT clause - Final aggregation
   *************************************************************************************/
  private NameSelectItemsVisitor getFinalSelectVisitor(Component lastComponent) {
    final TupleSchema tupleSchema = _compCost.get(lastComponent.getName()).getSchema();
    final NameSelectItemsVisitor selectVisitor = new NameSelectItemsVisitor(tupleSchema, _map,
        lastComponent);
    for (final SelectItem elem : _pq.getSelectItems())
      elem.accept(selectVisitor);
    return selectVisitor;
View Full Code Here

   * be built of inputTupleSchema (constants included)
   */
  private void processWhereForComponent(Component affectedComponent, Expression whereCompExpr) {
    if (whereCompExpr != null) {
      // first get the current schema of the component
      final TupleSchema tupleSchema = _compCost.get(affectedComponent.getName()).getSchema();
      final NameWhereVisitor whereVisitor = new NameWhereVisitor(tupleSchema,
          affectedComponent);
      whereCompExpr.accept(whereVisitor);
      attachWhereClause(affectedComponent, whereVisitor.getSelectOperator());
    }
View Full Code Here

        inputTupleSchema.add(new ColumnNameType("LINEITEM.EXTENDEDPRICE * (1.0 - LINEITEM.DISCOUNT)", _dblConv));
        inputTupleSchema.add(new ColumnNameType("EXTRACT_YEAR(LINEITEM.SHIPDATE)", _ic));
       
        EquiJoinComponent L_S_Njoin = createTPCH7_LSNSubplan();

        ProjSchemaCreator psc = new ProjSchemaCreator(_globalProject, new TupleSchema(inputTupleSchema), L_S_Njoin, _parsedQuery, _schema);
        psc.create();
       
        List<ColumnNameType> outputTupleSchema = psc.getOutputSchema().getSchema();
        ProjectOperator projectOperator = psc.getProjectOperator();
        
View Full Code Here

        inputTupleSchema.add(new ColumnNameType("1.0 - LINEITEM.DISCOUNT", _dblConv));
        inputTupleSchema.add(new ColumnNameType("LINEITEM.SHIPDATE", _ic));
       
        EquiJoinComponent L_S_Njoin = createTPCH7_LSNSubplan();

        ProjSchemaCreator psc = new ProjSchemaCreator(_globalProject, new TupleSchema(inputTupleSchema), L_S_Njoin, _parsedQuery, _schema);
        psc.create();
       
        List<ColumnNameType> outputTupleSchema = psc.getOutputSchema().getSchema();
        ProjectOperator projectOperator = psc.getProjectOperator();
        
View Full Code Here

        inputTupleSchema.add(new ColumnNameType("LINEITEM.DISCOUNT", _dblConv));
        inputTupleSchema.add(new ColumnNameType("LINEITEM.SHIPDATE", _ic));
       
        EquiJoinComponent L_S_Njoin = createTPCH7_LSNSubplan();

        ProjSchemaCreator psc = new ProjSchemaCreator(_globalProject, new TupleSchema(inputTupleSchema), L_S_Njoin, _parsedQuery, _schema);
        psc.create();
       
        List<ColumnNameType> outputTupleSchema = psc.getOutputSchema().getSchema();
        ProjectOperator projectOperator = psc.getProjectOperator();
        
View Full Code Here

TOP

Related Classes of sql.util.TupleSchema

Copyright © 2018 www.massapicom. 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.