Package ra

Examples of ra.Term.execute()


        System.out.println("----------------------------------------------------");

        Utils.reset();
        t = groupBy(rel(10), 1, 2).min(3).max(4).sum(5).count(6, 7).avg(8).countDistinct(9, 10);
        System.out.println(t);
        r = t.execute();
        System.out.println(r.getResultRelation());
        System.out.println(r.getFormulas());
        ats.storeAlgebra("examples/test_groupBy4.xml", t);
        ats.writeExcel("examples/excel_groupBy4.xlsx", r);
        t = ats.readAlgebra("examples/test_groupBy4.xml");
View Full Code Here


        //no columns to group over
        Utils.reset();
        t = groupBy(rel(10)).min(3).max(4).sum(5).count(6, 7).avg(8).countDistinct(9, 10);
        System.out.println(t);
        r = t.execute();
        System.out.println(r.getResultRelation());
        System.out.println(r.getFormulas());
        ats.storeAlgebra("examples/test_groupBy4_no_columns_to_group_over.xml", t);
        ats.writeExcel("examples/excel_groupBy4_no_columns_to_group_over.xlsx", r);
        t = ats.readAlgebra("examples/test_groupBy4_no_columns_to_group_over.xml");
View Full Code Here

        //CartProd
        Utils.reset();
        t = cartProd(rel(1), rel(1));
        System.out.println(t);
        r = t.execute();
        System.out.println(r.getResultRelation());
        System.out.println(r.getFormulas());
        ats.storeAlgebra("examples/test_cartProd1.xml", t);
        ats.writeExcel("examples/excel_cartProd1.xlsx", r);
        t = ats.readAlgebra("examples/test_cartProd1.xml");
View Full Code Here

        System.out.println("----------------------------------------------------");

        Utils.reset();
        t = cartProd(rel(2), rel(2));
        System.out.println(t);
        r = t.execute();
        System.out.println(r.getResultRelation());
        System.out.println(r.getFormulas());
        ats.storeAlgebra("examples/test_cartProd2.xml", t);
        ats.writeExcel("examples/excel_cartProd2.xlsx", r);
        t = ats.readAlgebra("examples/test_cartProd2.xml");
View Full Code Here

        System.out.println("----------------------------------------------------");

        Utils.reset();
        t = cartProd(rel(3), rel(3));
        System.out.println(t);
        r = t.execute();
        System.out.println(r.getResultRelation());
        System.out.println(r.getFormulas());
        ats.storeAlgebra("examples/test_cartProd1.xml", t);
        ats.writeExcel("examples/excel_cartProd1.xlsx", r);
        t = ats.readAlgebra("examples/test_cartProd1.xml");
View Full Code Here

        //Difference
        Utils.reset();
        t = diffBag(rel(1), rel(1));
        System.out.println(t);
        r = t.execute();
        System.out.println(r.getResultRelation());
        System.out.println(r.getFormulas());
        ats.storeAlgebra("examples/test_difference_bag1.xml", t);
        ats.writeExcel("examples/excel_difference_bag1.xlsx", r);
        t = ats.readAlgebra("examples/test_difference_bag1.xml");
View Full Code Here

        System.out.println("----------------------------------------------------");

        Utils.reset();
        t = diffBag(rel(2), rel(2));
        System.out.println(t);
        r = t.execute();
        System.out.println(r.getResultRelation());
        System.out.println(r.getFormulas());
        ats.storeAlgebra("examples/test_difference_bag2.xml", t);
        ats.writeExcel("examples/excel_difference_bag2.xlsx", r);
        t = ats.readAlgebra("examples/test_difference_bag2.xml");
View Full Code Here

        System.out.println("----------------------------------------------------");

        Utils.reset();
        t = diffSet(rel(1), rel(1));
        System.out.println(t);
        r = t.execute();
        System.out.println(r.getResultRelation());
        System.out.println(r.getFormulas());
        ats.storeAlgebra("examples/test_difference_set1.xml", t);
        ats.writeExcel("examples/excel_difference_set1.xlsx", r);
        t = ats.readAlgebra("examples/test_difference_set1.xml");
View Full Code Here

                /* translating the first query, then writing the first spreadsheet file take longer time, so let's
                 * warm up here */
                Schema schema = Schemas.fromDDL(DEFAULT_SCHEMA_TEXT);
                try {
                    Term translated = Queries.getRaOf(schema, DEFAULT_QUERY_TEXT);
                    Result result = translated.execute();
                    try (OutputStream os = new OutputStream() {
                        @Override
                        public void write(int b) throws IOException {
                            // nop
                        }};
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.