def execute_bql(stmt): req = SenseiRequest(stmt) store = my_client.store_map.get(req.index) if not store: print "Store %s does not exist!" % req.index return client = SenseiClient(store["broker_host"], store["broker_port"]) if req.stmt_type == "select": res = client.doQuery(req) res.display(req.get_columns(), 1000) elif req.stmt_type == "desc": sysinfo = client.getSystemInfo() sysinfo.display() else: print "Wrong command: %s" % stmt
def exe_sql(stmt, client): # test(stmt) req = SenseiRequest(stmt) res = client.doQuery(req) res.display(req.get_columns(), 1000)