Examples of TupleSchema


Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema

       
        //Adding a new start spec to get the group by spec. The new star spec that
        //we are adding should not contain a schema since that can cause conflicts.
       
        StarSpec ss = new StarSpec();
        ss.setSchema(new TupleSchema());
        specs.add(ss);
        return new GenerateSpec(specs);
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema

        return funcs;
    }

    @Override
    protected TupleSchema mapInputSchema(Schema input) {
        TupleSchema output = new TupleSchema();
               
        for (EvalSpec spec: specs) {
            Schema schema = spec.getOutputSchemaForPipe(input).copy();
           
            if (spec.isFlattened()){
                List<Schema> flattenedSchema = schema.flatten();
                if (flattenedSchema.size() == 0){
                    output.add(new TupleSchema(),true);
                    continue;
                }
                for (Schema flattenedItem: flattenedSchema){
                    output.add(flattenedItem,true);
                }
            }else{
                output.add(schema,false);
            }
        }
        return output;
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema

    @Override
    protected Schema mapInputSchema(Schema schema) {
        if (!wrapInTuple && cols.size()==1){
            return maskNullSchema(schema.schemaFor(cols.get(0)));
        }else{
            TupleSchema output = new TupleSchema();
            for (int i: cols){
                output.add(maskNullSchema(schema.schemaFor(i)));
            }
            return output;
        }
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema

        }
    }
   
    private Schema maskNullSchema(Schema s){
        if (s == null)
            return new TupleSchema();
        else
            return s;
       
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema

    }
   
    @Override
    protected Schema mapInputSchema(Schema schema) {
        //TODO: until we have map schemas
        return new TupleSchema();
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema

       
        // check if we can instantiate load func
        PigContext.instantiateFuncFromSpec(inputFileSpec.getFuncSpec());

        // TODO: Handle Schemas defined by Load Functions
        schema = new TupleSchema();
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema

        ifFalse.instantiateFunc(fInstantiaor);
    };

    @Override
    protected Schema mapInputSchema(Schema schema) {
        return new TupleSchema();
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema

    protected Schema mapInputSchema(Schema schema) {
        Schema inputToFunction;
        if (args!=null){
            inputToFunction = args.mapInputSchema(schema);
        }else{
            inputToFunction = new TupleSchema();
        }
       
        return func.outputSchema(inputToFunction);
    }
View Full Code Here

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

Examples of sql.util.TupleSchema

  // 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
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.