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
3
Example 1
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)
0
Example 2
def __init__(self, catalog):
self.parser = parser.Parser()
self.processor = interpreter.StatementProcessor(catalog)
0
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}
0
Example 4
def setUp(self):
self.db = self.create_db()
self.parser = parser.Parser()
self.processor = interpreter.StatementProcessor(self.db)