Examples of FieldSchema


Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

    private List<Integer> getByteArrayPositions(Schema s)
            throws VisitorException {
        List<Integer> result = new ArrayList<Integer>();
        for (int i = 0; i < s.size(); i++) {
            try {
                FieldSchema fs = s.getField(i);
                if (fs.type == DataType.BYTEARRAY) {
                    result.add(i);
                }
            } catch (FrontendException fee) {
                int errCode = 1043;
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

        Iterator<FieldSchema> i = inputSchema.getFields().iterator();
        Iterator<FieldSchema> j = udfSchema.getFields().iterator();

        while (i.hasNext()) {

            FieldSchema inputFieldSchema = i.next();
            FieldSchema udfFieldSchema = j.next();

            if(ignoreByteArrays && inputFieldSchema.type == DataType.BYTEARRAY) {
                continue;
            }
           
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

        if(sFields.size()!=fsFields.size())
            return INF;
        long score = 0;
        int castCnt=0;
        for(int i=0;i<sFields.size();i++){
            FieldSchema sFS = sFields.get(i);

            // if we have a byte array do not include it
            // in the computation of the score - bytearray
            // fields will be looked at separately outside
            // of this function
            if (sFS.type == DataType.BYTEARRAY)
                continue;

            FieldSchema fsFS = fsFields.get(i);
           
            if(DataType.isSchemaType(sFS.type)){
                if(!FieldSchema.equals(sFS, fsFS, false, true))
                    return INF;
            }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

        List<FieldSchema> tsLst = toSch.getFields();
        List<ExpressionOperator> args = udf.getArguments();
        int i=-1;
        for (FieldSchema fFSch : fsLst) {
            ++i;
            FieldSchema tFSch = tsLst.get(i);
            if(fFSch.type==tFSch.type) {
                continue;
            }
            insertCastForUDF(udf, fFSch, tFSch, args.get(i));
        }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

            project.setSentinel(true);
            genPlan.add(project);

            // add casting if necessary by comparing target types
            // to the input schema
            FieldSchema fs = null ;
            try {
                fs = fromSchema.getField(i) ;
            }
            catch(FrontendException fee) {
                int errCode = 1063;
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

                return streamLoaderSpec;
            }
           
            Schema s = op.getSchema();
            if(null != s) {
              FieldSchema fieldSchema = s.findFieldSchema( parentCanonicalName );
                getLoadFuncSpec( fieldSchema, loadFuncSpecMap );
            } else {
                LogicalPlan lp = op.getPlan();
                for(LogicalOperator pred: lp.getPredecessors(op)) {
                    FuncSpec lfSpec = getLoadFuncSpec(pred, parentCanonicalName);
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

        NegativeExpression op = new NegativeExpression(exprPlan, exprOpsMap.get(exp));
        exprOpsMap.put(uniOp, op);
    }

    public void visit(LOMapLookup colOp) throws VisitorException {
        FieldSchema fieldSchema;
        try {
            fieldSchema = colOp.getFieldSchema();
        } catch (FrontendException e) {
            throw new VisitorException( e.getMessage() );
        }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

        }
        try {
            if(type == DataType.ERROR){
                return Schema.generateNestedSchema(DataType.BAG, DataType.NULL);
            }
            FieldSchema innerFs = new Schema.FieldSchema(null, innerSchema, type);
            Schema innerSch = new Schema(innerFs);
            Schema bagSchema = new Schema(new FieldSchema(null, innerSch, DataType.BAG));
            return bagSchema;
        } catch (FrontendException e) {
            //This should not happen
            throw new RuntimeException("Bug : exception thrown while " +
                    "creating output schema for TOBAG udf", e);
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

    @Override
    public Schema.FieldSchema getFieldSchema() throws FrontendException {
        if(!mIsFieldSchemaComputed) {
            if(userSpecifiedFieldSchema != null) {
                mFieldSchema = new FieldSchema(userSpecifiedFieldSchema);
            } else {
                mFieldSchema = new Schema.FieldSchema(null, mType);
            }
            Schema.FieldSchema parFs  = getExpression().getFieldSchema();
            String canonicalName = (parFs != null ? parFs.canonicalName : null);
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

            return input;
        }
       
        @Override
        public Schema outputSchema(Schema input) {
            FieldSchema fs =
                new Schema.FieldSchema(getSchemaName("UDFTupleNullSchema", input),
                        DataType.TUPLE);
                return new Schema(fs);
        }
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.