raco.myrial.parser.Parser

Here are the examples of the python api raco.myrial.parser.Parser taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

Example 1

Project: raco Source File: test_case.py
Function: set_up
    def setUp(self):
        # SQLAlchemy
        self.db = SQLCatalog(sqlalchemy.
                             create_engine('sqlite:///:memory:', echo=True))
        self.db.add_table(self.emp_key, self.emp_schema)
        self.db.add_tuples(self.emp_key, self.emp_schema, self.emp_table)
        # MyriaL
        self.parser = parser.Parser()
        self.processor = interpreter.StatementProcessor(self.db)

Example 2

Project: raco Source File: clang_processor.py
Function: init
    def __init__(self, catalog):
        self.parser = parser.Parser()
        self.processor = interpreter.StatementProcessor(catalog)

Example 3

Project: raco Source File: test_myria_execution.py
def query(connection):
    # Get the physical plan for a test query
    catalog = MyriaCatalog(connection)
    servers = catalog.get_num_servers()

    parser = myrialparser.Parser()
    processor = interpreter.StatementProcessor(catalog, True)

    program = """
        books = scan(Brandon:Demo:MoreBooks);
        longerBooks = [from books where pages > 300 emit name];
        store(longerBooks, Brandon:Demo:LongerBooks);
        """

    statement_list = parser.parse(program)

    processor.evaluate(statement_list)

    pd = processor.get_physical_plan(target_alg=MyriaLeftDeepTreeAlgebra())

    json = processor.get_json_from_physical_plan(pd)

    return {'rawQuery': program,
            'logicalRa': 'empty',
            'fragments': json}

Example 4

Project: raco Source File: myrial_test.py
Function: set_up
    def setUp(self):
        self.db = self.create_db()

        self.parser = parser.Parser()
        self.processor = interpreter.StatementProcessor(self.db)