Examples of HandleSpec


Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

                    FuncSpec loadFuncSpec = null;
                    if(op instanceof LOLoad) {
                        loadFuncSpec = ((LOLoad)op).getFileSpec().getFuncSpec();
                    } else if (op instanceof LOStream) {
                        StreamingCommand command = ((LOStream)op).getStreamingCommand();
                        HandleSpec streamOutputSpec = command.getOutputSpec();
                        loadFuncSpec = new FuncSpec(streamOutputSpec.getSpec());
                    } else {
                        String msg = "TypeCastInserter invoked with an invalid operator class name: " + innerPlan.getClass().getSimpleName();
                        throw new FrontendException(msg, 2242);
                    }
                    cast.setFuncSpec(loadFuncSpec);
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

        processError("\nEnd time: " + new Date(System.currentTimeMillis()));
        processError("\nExit code: " + exitCode);

        List<HandleSpec> inputSpecs = command.getHandleSpecs(Handle.INPUT);
        HandleSpec inputSpec =
            (inputSpecs != null) ? inputSpecs.get(0) : null;
        if (inputSpec == null ||
            !inputSpec.getSpec().contains("BinaryStorage")) {
            processError("\nInput records: " + inputRecords);
        }
        processError("\nInput bytes: " + inputBytes + " bytes " +
                    ((inputSpec != null) ?
                            "(" + inputSpec.getName() + " using " +
                                inputSpec.getSpec() + ")"
                            : ""));

        List<HandleSpec> outputSpecs = command.getHandleSpecs(Handle.OUTPUT);
        HandleSpec outputSpec =
            (outputSpecs != null) ? outputSpecs.get(0) : null;
        if (outputSpec == null ||
            !outputSpec.getSpec().contains("BinaryStorage")) {
            processError("\nOutput records: " + outputRecords);
        }
        processError("\nOutput bytes: " + outputBytes + " bytes " +
                     ((outputSpec != null) ?
                         "(" + outputSpec.getName() + " using " +
                             outputSpec.getSpec() + ")"
                         : ""));
        if (outputSpecs != null) {
            for (int i=1; i < outputSpecs.size(); ++i) {
                HandleSpec spec = outputSpecs.get(i);
                processError("\n           " + new File(spec.getName()).length()
                             + " bytes using " + spec.getSpec());
            }
        }

        processError("\n=====          * * *          =====\n");
    }
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

        } else {
            if(op instanceof LOLoad) {
                return ((LOLoad)op).getInputFile().getFuncSpec();
            } else if (op instanceof LOStream) {
                StreamingCommand command = ((LOStream)op).getStreamingCommand();
                HandleSpec streamOutputSpec = command.getOutputSpec();
                FuncSpec streamLoaderSpec = new FuncSpec(streamOutputSpec.getSpec());
                return streamLoaderSpec;
            }
           
            Schema s = op.getSchema();
            if(null != s) {
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

                            FuncSpec loadFuncSpec = null;
                            if(lo instanceof LOLoad) {
                                loadFuncSpec = ((LOLoad)lo).getInputFile().getFuncSpec();
                            } else if (lo instanceof LOStream) {
                                StreamingCommand command = ((LOStream)lo).getStreamingCommand();
                                HandleSpec streamOutputSpec = command.getOutputSpec();
                                loadFuncSpec = new FuncSpec(streamOutputSpec.getSpec());
                            } else {
                                int errCode = 2006;
                                String msg = "TypeCastInserter invoked with an invalid operator class name: " + lo.getClass().getSimpleName();
                                throw new OptimizerException(msg, errCode, PigException.BUG);
                            }
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

        // untouched.

        StreamingCommand optimizedCommand = (StreamingCommand)command.clone();
       
        if (handle == Handle.INPUT) {
            HandleSpec streamInputSpec = optimizedCommand.getInputSpec();
            streamInputSpec.setSpec(spec);
        } else if (handle == Handle.OUTPUT) {
            HandleSpec streamOutputSpec = optimizedCommand.getOutputSpec();
            streamOutputSpec.setSpec(spec);
        }
       
        command = optimizedCommand;
    }
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

        } else {
            if(op instanceof LOLoad) {
                return ((LOLoad)op).getInputFile().getFuncSpec();
            } else if (op instanceof LOStream) {
                StreamingCommand command = ((LOStream)op).getStreamingCommand();
                HandleSpec streamOutputSpec = command.getOutputSpec();
                FuncSpec streamLoaderSpec = new FuncSpec(streamOutputSpec.getSpec());
                return streamLoaderSpec;
            }
           
            Schema s = op.getSchema();
            if(null != s) {
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

                            FuncSpec loadFuncSpec = null;
                            if(lo instanceof LOLoad) {
                                loadFuncSpec = ((LOLoad)lo).getInputFile().getFuncSpec();
                            } else if (lo instanceof LOStream) {
                                StreamingCommand command = ((LOStream)lo).getStreamingCommand();
                                HandleSpec streamOutputSpec = command.getOutputSpec();
                                loadFuncSpec = new FuncSpec(streamOutputSpec.getSpec());
                            } else {
                                int errCode = 2006;
                                String msg = "TypeCastInserter invoked with an invalid operator class name: " + lo.getClass().getSimpleName();
                                throw new OptimizerException(msg, errCode, PigException.BUG);
                            }
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

        // untouched.

        StreamingCommand optimizedCommand = (StreamingCommand)command.clone();
       
        if (handle == Handle.INPUT) {
            HandleSpec streamInputSpec = optimizedCommand.getInputSpec();
            streamInputSpec.setSpec(spec);
        } else if (handle == Handle.OUTPUT) {
            HandleSpec streamOutputSpec = optimizedCommand.getOutputSpec();
            streamOutputSpec.setSpec(spec);
        }
       
        command = optimizedCommand;
    }
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

            EvalSpec spec = eval.getSpec();
            if (spec instanceof StreamSpec) {
                // Try and optimize if the store and stream output specs match
                StreamSpec streamSpec = (StreamSpec)spec;
                StreamingCommand command = streamSpec.getCommand();
                HandleSpec streamOutputSpec = command.getOutputSpec();
               
                FileSpec storeFileSpec = s.getOutputFileSpec();
               
                // Instantiate both to compare them for equality
                LoadFunc streamLoader =
                    (LoadFunc)PigContext.instantiateFuncFromSpec(
                            streamOutputSpec.getSpec());
               
                StoreFunc outputStorer = (StoreFunc)PigContext.instantiateFuncFromSpec(
                                                storeFileSpec.getFuncSpec());
               
View Full Code Here

Examples of org.apache.pig.impl.streaming.StreamingCommand.HandleSpec

        if (optimizedCommand == null) {
            optimizedCommand = (StreamingCommand)command.clone();
        }
       
        if (handle == Handle.INPUT) {
            HandleSpec streamInputSpec = optimizedCommand.getInputSpec();
            streamInputSpec.setSpec(spec);
        } else if (handle == Handle.OUTPUT) {
            HandleSpec streamOutputSpec = optimizedCommand.getOutputSpec();
            streamOutputSpec.setSpec(spec);
        }
       
        command = optimizedCommand;
    }
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.