Package org.apache.pig.impl.logicalLayer

Examples of org.apache.pig.impl.logicalLayer.LogicalPlanBuilder


            }

            query = query.trim();
       
            try {
                return new LogicalPlanBuilder(PigServer.this.pigContext).parse(scope, query,
                                              aliases, opTable, aliasOp, startLine, fileNameMap);
            } catch (ParseException e) {
                PigException pe = LogUtils.getPigException(e);
                int errCode = 1000;
                String msg = "Error during parsing. " + (pe == null? e.getMessage() : pe.getMessage());
View Full Code Here


        PigContext pigContext = new PigContext(ExecType.LOCAL, new Properties());
        try {

            pigContext.connect();
           
            LogicalPlanBuilder builder = new LogicalPlanBuilder(pigContext); //


            LogicalPlan lp = builder.parse("Test-Plan-Builder",
                                           query,
                                           aliases,
                                           logicalOpTable,
                                           aliasOp,
                                           fileNameMap);
View Full Code Here

            }

            query = query.trim();
       
            try {
                return new LogicalPlanBuilder(PigServer.this.pigContext).parse(scope, query,
                                              aliases, opTable, aliasOp, startLine, fileNameMap);
            } catch (ParseException e) {
                PigException pe = LogUtils.getPigException(e);
                int errCode = 1000;
                String msg = "Error during parsing. " + (pe == null? e.getMessage() : pe.getMessage());
View Full Code Here

            Map<LogicalOperator, LogicalPlan> aliases = new HashMap<LogicalOperator, LogicalPlan>();
            Map<OperatorKey, LogicalOperator> logicalOpTable = new HashMap<OperatorKey, LogicalOperator>();
            Map<String, LogicalOperator> aliasOp = new HashMap<String, LogicalOperator>();
            Map<String, String> fileNameMap = new HashMap<String, String>();
           
            LogicalPlanBuilder builder = new LogicalPlanBuilder(pc);
           
            String query = "a = load '"+orig+"';";
            LogicalPlan lp = builder.parse("Test-Load",
                                           query,
                                           aliases,
                                           logicalOpTable,
                                           aliasOp,
                                           fileNameMap);
View Full Code Here

    }

    public LogicalPlan buildPlan(String query, ClassLoader cldr) {
        LogicalPlanBuilder.classloader = cldr;

        LogicalPlanBuilder builder = new LogicalPlanBuilder(pigContext); //

        try {
            String[] qs = query.split(";");
            LogicalPlan lp = null;
            for (String q: qs) {
                q = q.trim();
                if (q.equals(""))
                    continue;
                q += ";";
                System.out.println(q);
                lp = builder.parse("Test-Plan-Builder", q, aliases,
                                   logicalOpTable, aliasOp, fileNameMap);
            }

            List<LogicalOperator> roots = lp.getRoots();
View Full Code Here

        Map<LogicalOperator, LogicalPlan> aliases = new HashMap<LogicalOperator, LogicalPlan>();
        Map<OperatorKey, LogicalOperator> logicalOpTable = new HashMap<OperatorKey, LogicalOperator>();
        Map<String, LogicalOperator> aliasOp = new HashMap<String, LogicalOperator>();
        Map<String, String> fileNameMap = new HashMap<String, String>();
       
        LogicalPlanBuilder builder = new LogicalPlanBuilder(pc);
       
        String query = "a = load 'foo';";
        LogicalPlan lp = builder.parse("Test-Store",
                                       query,
                                       aliases,
                                       logicalOpTable,
                                       aliasOp,
                                       fileNameMap);
        query = "store a into '"+orig+"';";
        lp = builder.parse("Test-Store",
                           query,
                           aliases,
                           logicalOpTable,
                           aliasOp,
                           fileNameMap);
View Full Code Here

            Map<LogicalOperator, LogicalPlan> aliases = new HashMap<LogicalOperator, LogicalPlan>();
            Map<OperatorKey, LogicalOperator> logicalOpTable = new HashMap<OperatorKey, LogicalOperator>();
            Map<String, LogicalOperator> aliasOp = new HashMap<String, LogicalOperator>();
            Map<String, String> fileNameMap = new HashMap<String, String>();
           
            LogicalPlanBuilder builder = new LogicalPlanBuilder(pc);
           
            String query = "a = load '"+orig+"';";
            LogicalPlan lp = builder.parse("Test-Load",
                                           query,
                                           aliases,
                                           logicalOpTable,
                                           aliasOp,
                                           fileNameMap);
View Full Code Here

        Map<LogicalOperator, LogicalPlan> aliases = new HashMap<LogicalOperator, LogicalPlan>();
        Map<OperatorKey, LogicalOperator> logicalOpTable = new HashMap<OperatorKey, LogicalOperator>();
        Map<String, LogicalOperator> aliasOp = new HashMap<String, LogicalOperator>();
        Map<String, String> fileNameMap = new HashMap<String, String>();
       
        LogicalPlanBuilder builder = new LogicalPlanBuilder(pc);
       
        String query = "a = load 'foo';";
        LogicalPlan lp = builder.parse("Test-Store",
                                       query,
                                       aliases,
                                       logicalOpTable,
                                       aliasOp,
                                       fileNameMap);
        query = "store a into '"+orig+"';";
        lp = builder.parse("Test-Store",
                           query,
                           aliases,
                           logicalOpTable,
                           aliasOp,
                           fileNameMap);
View Full Code Here

    }

    public LogicalPlan buildPlan(String query, ClassLoader cldr) {
        LogicalPlanBuilder.classloader = cldr;

        LogicalPlanBuilder builder = new LogicalPlanBuilder(pigContext); //

        try {
            String[] qs = query.split(";");
            LogicalPlan lp = null;
            for (String q: qs) {
                q = q.trim();
                if (q.equals(""))
                    continue;
                q += ";";
                System.out.println(q);
                lp = builder.parse("Test-Plan-Builder", q, aliases,
                                   logicalOpTable, aliasOp, fileNameMap);
            }

            List<LogicalOperator> roots = lp.getRoots();
View Full Code Here

        PigContext pigContext = new PigContext(ExecType.LOCAL, new Properties());
        try {

            pigContext.connect();
           
            LogicalPlanBuilder builder = new LogicalPlanBuilder(pigContext); //


            LogicalPlan lp = builder.parse("Test-Plan-Builder",
                                           query,
                                           aliases,
                                           logicalOpTable,
                                           aliasOp,
                                           fileNameMap);
View Full Code Here

TOP

Related Classes of org.apache.pig.impl.logicalLayer.LogicalPlanBuilder

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.