diff --git a/README.md b/README.md index c04918b..5c7de8d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # e6data Python Connector -![version](https://img.shields.io/badge/version-1.0.4-blue.svg) +![version](https://img.shields.io/badge/version-1.0.5-blue.svg) ## Introduction diff --git a/e6xdb/e6x.py b/e6xdb/e6x.py index 9e15045..44e82a3 100644 --- a/e6xdb/e6x.py +++ b/e6xdb/e6x.py @@ -189,15 +189,42 @@ def query_cancel(self, query_id): def dry_run(self, query): return self._client.dryRun(sessionId=self.get_session_id, sSchema=self._database, sQueryString=query) + def dry_run_v2(self, catalog_name, query): + return self._client.dryRunV2( + sessionId=self.get_session_id, + catalogName=catalog_name, + sSchema=self._database, + sQueryString=query + ) + def get_tables(self, database): return self._client.getTables(sessionId=self.get_session_id, schema=database) + def get_tables_v2(self, catalog_name, database): + return self._client.getTablesV2(sessionId=self.get_session_id, catalogName=catalog_name, schema=database) + def get_columns(self, database, table): - return self._client.getColumns(sessionId=self.get_session_id, schema=database, table=table) + catalog_name = '' + return self._client.getColumns(sessionId=self.get_session_id, catalogName=catalog_name, schema=database, + table=table) + + def get_columns_v2(self, catalog_name, database, table): + return self._client.getColumnsV2( + sessionId=self.get_session_id, + catalogName=catalog_name, + schema=database, + table=table + ) def get_schema_names(self): return self._client.getSchemaNames(sessionId=self.get_session_id) + def get_schema_names_v2(self, catalog_name): + return self._client.getSchemaNamesV2(sessionId=self.get_session_id, catalogName=catalog_name) + + def add_catalogs(self, catalogs_info): + return self._client.addCatalogs(sessionId=self.get_session_id, jsonString=catalogs_info) + def commit(self): """We do not support transactions, so this does nothing.""" pass @@ -222,8 +249,9 @@ class Cursor(DBAPICursor): """ rows_count = 0 - def __init__(self, connection, arraysize=1000, database=None): + def __init__(self, connection, catalog_name=None, arraysize=1000, database=None): super(Cursor, self).__init__() + self._catalog_name = catalog_name self._arraysize = arraysize self.connection = connection self._data = None @@ -332,11 +360,19 @@ def execute(self, operation, parameters=None, **kwargs): sql = operation % _escaper.escape_args(parameters) client = self.connection.client - self._query_id = client.prepareStatement( - self.connection.get_session_id, - self._database, - sql - ) + if self._catalog_name: + self._query_id = client.prepareStatementV2( + self.connection.get_session_id, + self._catalog_name, + self._database, + sql + ) + else: + self._query_id = client.prepareStatement( + self.connection.get_session_id, + self._database, + sql + ) client.executeStatement(self.connection.get_session_id, self._query_id) self.update_mete_data() return self._query_id diff --git a/e6xdb/server/QueryEngineService-remote b/e6xdb/server/QueryEngineService-remote index c49a243..630cd06 100755 --- a/e6xdb/server/QueryEngineService-remote +++ b/e6xdb/server/QueryEngineService-remote @@ -28,18 +28,24 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print(' void cancelQuery(string sessionId, string queryId)') print(' string explain(string sessionId, string queryId)') print(' string dryRun(string sessionId, string sSchema, string sQueryString)') + print(' string dryRunV2(string sessionId, string catalogName, string sSchema, string sQueryString)') print(' string explainAnalyze(string sessionId, string queryId)') print(' string prepareStatement(string sessionId, string sSchemaName, string query)') + print(' string prepareStatementV2(string sessionId, string catalogName, string sSchemaName, string query)') print(' void executeStatement(string sessionId, string queryId)') print(' string getNextResultRow(string sessionId, string queryId)') print(' string getNextResultBatch(string sessionId, string queryId)') print(' string getResultMetadata(string sessionId, string queryId)') print(' string authenticate(string user, string password)') print(' getTables(string sessionId, string schema)') + print(' getTablesV2(string sessionId, string catalogName, string schema)') print(' getSchemaNames(string sessionId)') - print(' getColumns(string sessionId, string schema, string table)') + print(' getSchemaNamesV2(string sessionId, string catalogName)') + print(' getColumns(string sessionId, string catalogName, string schema, string table)') + print(' getColumnsV2(string sessionId, string catalogName, string schema, string table)') print(' void updateUsers(string userInfo)') print(' void setProps(string sessionId, string propMap)') + print(' void addCatalogs(string sessionId, string jsonString)') print('') sys.exit(0) @@ -143,6 +149,12 @@ elif cmd == 'dryRun': sys.exit(1) pp.pprint(client.dryRun(args[0], args[1], args[2],)) +elif cmd == 'dryRunV2': + if len(args) != 4: + print('dryRunV2 requires 4 args') + sys.exit(1) + pp.pprint(client.dryRunV2(args[0], args[1], args[2], args[3],)) + elif cmd == 'explainAnalyze': if len(args) != 2: print('explainAnalyze requires 2 args') @@ -155,6 +167,12 @@ elif cmd == 'prepareStatement': sys.exit(1) pp.pprint(client.prepareStatement(args[0], args[1], args[2],)) +elif cmd == 'prepareStatementV2': + if len(args) != 4: + print('prepareStatementV2 requires 4 args') + sys.exit(1) + pp.pprint(client.prepareStatementV2(args[0], args[1], args[2], args[3],)) + elif cmd == 'executeStatement': if len(args) != 2: print('executeStatement requires 2 args') @@ -191,17 +209,35 @@ elif cmd == 'getTables': sys.exit(1) pp.pprint(client.getTables(args[0], args[1],)) +elif cmd == 'getTablesV2': + if len(args) != 3: + print('getTablesV2 requires 3 args') + sys.exit(1) + pp.pprint(client.getTablesV2(args[0], args[1], args[2],)) + elif cmd == 'getSchemaNames': if len(args) != 1: print('getSchemaNames requires 1 args') sys.exit(1) pp.pprint(client.getSchemaNames(args[0],)) +elif cmd == 'getSchemaNamesV2': + if len(args) != 2: + print('getSchemaNamesV2 requires 2 args') + sys.exit(1) + pp.pprint(client.getSchemaNamesV2(args[0], args[1],)) + elif cmd == 'getColumns': - if len(args) != 3: - print('getColumns requires 3 args') + if len(args) != 4: + print('getColumns requires 4 args') + sys.exit(1) + pp.pprint(client.getColumns(args[0], args[1], args[2], args[3],)) + +elif cmd == 'getColumnsV2': + if len(args) != 4: + print('getColumnsV2 requires 4 args') sys.exit(1) - pp.pprint(client.getColumns(args[0], args[1], args[2],)) + pp.pprint(client.getColumnsV2(args[0], args[1], args[2], args[3],)) elif cmd == 'updateUsers': if len(args) != 1: @@ -215,6 +251,12 @@ elif cmd == 'setProps': sys.exit(1) pp.pprint(client.setProps(args[0], args[1],)) +elif cmd == 'addCatalogs': + if len(args) != 2: + print('addCatalogs requires 2 args') + sys.exit(1) + pp.pprint(client.addCatalogs(args[0], args[1],)) + else: print('Unrecognized method %s' % cmd) sys.exit(1) diff --git a/e6xdb/server/QueryEngineService.py b/e6xdb/server/QueryEngineService.py index 6ebd561..747d7d6 100644 --- a/e6xdb/server/QueryEngineService.py +++ b/e6xdb/server/QueryEngineService.py @@ -56,6 +56,17 @@ def dryRun(self, sessionId, sSchema, sQueryString): """ pass + def dryRunV2(self, sessionId, catalogName, sSchema, sQueryString): + """ + Parameters: + - sessionId + - catalogName + - sSchema + - sQueryString + + """ + pass + def explainAnalyze(self, sessionId, queryId): """ Parameters: @@ -75,6 +86,17 @@ def prepareStatement(self, sessionId, sSchemaName, query): """ pass + def prepareStatementV2(self, sessionId, catalogName, sSchemaName, query): + """ + Parameters: + - sessionId + - catalogName + - sSchemaName + - query + + """ + pass + def executeStatement(self, sessionId, queryId): """ Parameters: @@ -129,6 +151,16 @@ def getTables(self, sessionId, schema): """ pass + def getTablesV2(self, sessionId, catalogName, schema): + """ + Parameters: + - sessionId + - catalogName + - schema + + """ + pass + def getSchemaNames(self, sessionId): """ Parameters: @@ -137,10 +169,31 @@ def getSchemaNames(self, sessionId): """ pass - def getColumns(self, sessionId, schema, table): + def getSchemaNamesV2(self, sessionId, catalogName): + """ + Parameters: + - sessionId + - catalogName + + """ + pass + + def getColumns(self, sessionId, catalogName, schema, table): + """ + Parameters: + - sessionId + - catalogName + - schema + - table + + """ + pass + + def getColumnsV2(self, sessionId, catalogName, schema, table): """ Parameters: - sessionId + - catalogName - schema - table @@ -164,6 +217,15 @@ def setProps(self, sessionId, propMap): """ pass + def addCatalogs(self, sessionId, jsonString): + """ + Parameters: + - sessionId + - jsonString + + """ + pass + class Client(Iface): def __init__(self, iprot, oprot=None): @@ -322,6 +384,48 @@ def recv_dryRun(self): raise result.error2 raise TApplicationException(TApplicationException.MISSING_RESULT, "dryRun failed: unknown result") + def dryRunV2(self, sessionId, catalogName, sSchema, sQueryString): + """ + Parameters: + - sessionId + - catalogName + - sSchema + - sQueryString + + """ + self.send_dryRunV2(sessionId, catalogName, sSchema, sQueryString) + return self.recv_dryRunV2() + + def send_dryRunV2(self, sessionId, catalogName, sSchema, sQueryString): + self._oprot.writeMessageBegin('dryRunV2', TMessageType.CALL, self._seqid) + args = dryRunV2_args() + args.sessionId = sessionId + args.catalogName = catalogName + args.sSchema = sSchema + args.sQueryString = sQueryString + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_dryRunV2(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = dryRunV2_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.error1 is not None: + raise result.error1 + if result.error2 is not None: + raise result.error2 + raise TApplicationException(TApplicationException.MISSING_RESULT, "dryRunV2 failed: unknown result") + def explainAnalyze(self, sessionId, queryId): """ Parameters: @@ -400,6 +504,48 @@ def recv_prepareStatement(self): raise result.error2 raise TApplicationException(TApplicationException.MISSING_RESULT, "prepareStatement failed: unknown result") + def prepareStatementV2(self, sessionId, catalogName, sSchemaName, query): + """ + Parameters: + - sessionId + - catalogName + - sSchemaName + - query + + """ + self.send_prepareStatementV2(sessionId, catalogName, sSchemaName, query) + return self.recv_prepareStatementV2() + + def send_prepareStatementV2(self, sessionId, catalogName, sSchemaName, query): + self._oprot.writeMessageBegin('prepareStatementV2', TMessageType.CALL, self._seqid) + args = prepareStatementV2_args() + args.sessionId = sessionId + args.catalogName = catalogName + args.sSchemaName = sSchemaName + args.query = query + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_prepareStatementV2(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = prepareStatementV2_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.error1 is not None: + raise result.error1 + if result.error2 is not None: + raise result.error2 + raise TApplicationException(TApplicationException.MISSING_RESULT, "prepareStatementV2 failed: unknown result") + def executeStatement(self, sessionId, queryId): """ Parameters: @@ -624,6 +770,46 @@ def recv_getTables(self): raise result.error2 raise TApplicationException(TApplicationException.MISSING_RESULT, "getTables failed: unknown result") + def getTablesV2(self, sessionId, catalogName, schema): + """ + Parameters: + - sessionId + - catalogName + - schema + + """ + self.send_getTablesV2(sessionId, catalogName, schema) + return self.recv_getTablesV2() + + def send_getTablesV2(self, sessionId, catalogName, schema): + self._oprot.writeMessageBegin('getTablesV2', TMessageType.CALL, self._seqid) + args = getTablesV2_args() + args.sessionId = sessionId + args.catalogName = catalogName + args.schema = schema + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getTablesV2(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getTablesV2_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.error1 is not None: + raise result.error1 + if result.error2 is not None: + raise result.error2 + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTablesV2 failed: unknown result") + def getSchemaNames(self, sessionId): """ Parameters: @@ -660,21 +846,61 @@ def recv_getSchemaNames(self): raise result.error2 raise TApplicationException(TApplicationException.MISSING_RESULT, "getSchemaNames failed: unknown result") - def getColumns(self, sessionId, schema, table): + def getSchemaNamesV2(self, sessionId, catalogName): + """ + Parameters: + - sessionId + - catalogName + + """ + self.send_getSchemaNamesV2(sessionId, catalogName) + return self.recv_getSchemaNamesV2() + + def send_getSchemaNamesV2(self, sessionId, catalogName): + self._oprot.writeMessageBegin('getSchemaNamesV2', TMessageType.CALL, self._seqid) + args = getSchemaNamesV2_args() + args.sessionId = sessionId + args.catalogName = catalogName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getSchemaNamesV2(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getSchemaNamesV2_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.error1 is not None: + raise result.error1 + if result.error2 is not None: + raise result.error2 + raise TApplicationException(TApplicationException.MISSING_RESULT, "getSchemaNamesV2 failed: unknown result") + + def getColumns(self, sessionId, catalogName, schema, table): """ Parameters: - sessionId + - catalogName - schema - table """ - self.send_getColumns(sessionId, schema, table) + self.send_getColumns(sessionId, catalogName, schema, table) return self.recv_getColumns() - def send_getColumns(self, sessionId, schema, table): + def send_getColumns(self, sessionId, catalogName, schema, table): self._oprot.writeMessageBegin('getColumns', TMessageType.CALL, self._seqid) args = getColumns_args() args.sessionId = sessionId + args.catalogName = catalogName args.schema = schema args.table = table args.write(self._oprot) @@ -700,6 +926,48 @@ def recv_getColumns(self): raise result.error2 raise TApplicationException(TApplicationException.MISSING_RESULT, "getColumns failed: unknown result") + def getColumnsV2(self, sessionId, catalogName, schema, table): + """ + Parameters: + - sessionId + - catalogName + - schema + - table + + """ + self.send_getColumnsV2(sessionId, catalogName, schema, table) + return self.recv_getColumnsV2() + + def send_getColumnsV2(self, sessionId, catalogName, schema, table): + self._oprot.writeMessageBegin('getColumnsV2', TMessageType.CALL, self._seqid) + args = getColumnsV2_args() + args.sessionId = sessionId + args.catalogName = catalogName + args.schema = schema + args.table = table + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getColumnsV2(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getColumnsV2_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.error1 is not None: + raise result.error1 + if result.error2 is not None: + raise result.error2 + raise TApplicationException(TApplicationException.MISSING_RESULT, "getColumnsV2 failed: unknown result") + def updateUsers(self, userInfo): """ Parameters: @@ -768,6 +1036,42 @@ def recv_setProps(self): raise result.error2 return + def addCatalogs(self, sessionId, jsonString): + """ + Parameters: + - sessionId + - jsonString + + """ + self.send_addCatalogs(sessionId, jsonString) + self.recv_addCatalogs() + + def send_addCatalogs(self, sessionId, jsonString): + self._oprot.writeMessageBegin('addCatalogs', TMessageType.CALL, self._seqid) + args = addCatalogs_args() + args.sessionId = sessionId + args.jsonString = jsonString + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_addCatalogs(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = addCatalogs_result() + result.read(iprot) + iprot.readMessageEnd() + if result.error1 is not None: + raise result.error1 + if result.error2 is not None: + raise result.error2 + return + class Processor(Iface, TProcessor): def __init__(self, handler): @@ -777,18 +1081,24 @@ def __init__(self, handler): self._processMap["cancelQuery"] = Processor.process_cancelQuery self._processMap["explain"] = Processor.process_explain self._processMap["dryRun"] = Processor.process_dryRun + self._processMap["dryRunV2"] = Processor.process_dryRunV2 self._processMap["explainAnalyze"] = Processor.process_explainAnalyze self._processMap["prepareStatement"] = Processor.process_prepareStatement + self._processMap["prepareStatementV2"] = Processor.process_prepareStatementV2 self._processMap["executeStatement"] = Processor.process_executeStatement self._processMap["getNextResultRow"] = Processor.process_getNextResultRow self._processMap["getNextResultBatch"] = Processor.process_getNextResultBatch self._processMap["getResultMetadata"] = Processor.process_getResultMetadata self._processMap["authenticate"] = Processor.process_authenticate self._processMap["getTables"] = Processor.process_getTables + self._processMap["getTablesV2"] = Processor.process_getTablesV2 self._processMap["getSchemaNames"] = Processor.process_getSchemaNames + self._processMap["getSchemaNamesV2"] = Processor.process_getSchemaNamesV2 self._processMap["getColumns"] = Processor.process_getColumns + self._processMap["getColumnsV2"] = Processor.process_getColumnsV2 self._processMap["updateUsers"] = Processor.process_updateUsers self._processMap["setProps"] = Processor.process_setProps + self._processMap["addCatalogs"] = Processor.process_addCatalogs self._on_message_begin = None def on_message_begin(self, func): @@ -927,13 +1237,13 @@ def process_dryRun(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() - def process_explainAnalyze(self, seqid, iprot, oprot): - args = explainAnalyze_args() + def process_dryRunV2(self, seqid, iprot, oprot): + args = dryRunV2_args() args.read(iprot) iprot.readMessageEnd() - result = explainAnalyze_result() + result = dryRunV2_result() try: - result.success = self._handler.explainAnalyze(args.sessionId, args.queryId) + result.success = self._handler.dryRunV2(args.sessionId, args.catalogName, args.sSchema, args.sQueryString) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise @@ -951,18 +1261,18 @@ def process_explainAnalyze(self, seqid, iprot, oprot): logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("explainAnalyze", msg_type, seqid) + oprot.writeMessageBegin("dryRunV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_prepareStatement(self, seqid, iprot, oprot): - args = prepareStatement_args() + def process_explainAnalyze(self, seqid, iprot, oprot): + args = explainAnalyze_args() args.read(iprot) iprot.readMessageEnd() - result = prepareStatement_result() + result = explainAnalyze_result() try: - result.success = self._handler.prepareStatement(args.sessionId, args.sSchemaName, args.query) + result.success = self._handler.explainAnalyze(args.sessionId, args.queryId) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise @@ -980,18 +1290,18 @@ def process_prepareStatement(self, seqid, iprot, oprot): logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("prepareStatement", msg_type, seqid) + oprot.writeMessageBegin("explainAnalyze", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_executeStatement(self, seqid, iprot, oprot): - args = executeStatement_args() + def process_prepareStatement(self, seqid, iprot, oprot): + args = prepareStatement_args() args.read(iprot) iprot.readMessageEnd() - result = executeStatement_result() + result = prepareStatement_result() try: - self._handler.executeStatement(args.sessionId, args.queryId) + result.success = self._handler.prepareStatement(args.sessionId, args.sSchemaName, args.query) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise @@ -1009,18 +1319,18 @@ def process_executeStatement(self, seqid, iprot, oprot): logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("executeStatement", msg_type, seqid) + oprot.writeMessageBegin("prepareStatement", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getNextResultRow(self, seqid, iprot, oprot): - args = getNextResultRow_args() + def process_prepareStatementV2(self, seqid, iprot, oprot): + args = prepareStatementV2_args() args.read(iprot) iprot.readMessageEnd() - result = getNextResultRow_result() + result = prepareStatementV2_result() try: - result.success = self._handler.getNextResultRow(args.sessionId, args.queryId) + result.success = self._handler.prepareStatementV2(args.sessionId, args.catalogName, args.sSchemaName, args.query) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise @@ -1038,13 +1348,71 @@ def process_getNextResultRow(self, seqid, iprot, oprot): logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("getNextResultRow", msg_type, seqid) + oprot.writeMessageBegin("prepareStatementV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getNextResultBatch(self, seqid, iprot, oprot): - args = getNextResultBatch_args() + def process_executeStatement(self, seqid, iprot, oprot): + args = executeStatement_args() + args.read(iprot) + iprot.readMessageEnd() + result = executeStatement_result() + try: + self._handler.executeStatement(args.sessionId, args.queryId) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except QueryProcessingException as error1: + msg_type = TMessageType.REPLY + result.error1 = error1 + except AccessDeniedException as error2: + msg_type = TMessageType.REPLY + result.error2 = error2 + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("executeStatement", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getNextResultRow(self, seqid, iprot, oprot): + args = getNextResultRow_args() + args.read(iprot) + iprot.readMessageEnd() + result = getNextResultRow_result() + try: + result.success = self._handler.getNextResultRow(args.sessionId, args.queryId) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except QueryProcessingException as error1: + msg_type = TMessageType.REPLY + result.error1 = error1 + except AccessDeniedException as error2: + msg_type = TMessageType.REPLY + result.error2 = error2 + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getNextResultRow", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getNextResultBatch(self, seqid, iprot, oprot): + args = getNextResultBatch_args() args.read(iprot) iprot.readMessageEnd() result = getNextResultBatch_result() @@ -1156,6 +1524,35 @@ def process_getTables(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_getTablesV2(self, seqid, iprot, oprot): + args = getTablesV2_args() + args.read(iprot) + iprot.readMessageEnd() + result = getTablesV2_result() + try: + result.success = self._handler.getTablesV2(args.sessionId, args.catalogName, args.schema) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except QueryProcessingException as error1: + msg_type = TMessageType.REPLY + result.error1 = error1 + except AccessDeniedException as error2: + msg_type = TMessageType.REPLY + result.error2 = error2 + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getTablesV2", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_getSchemaNames(self, seqid, iprot, oprot): args = getSchemaNames_args() args.read(iprot) @@ -1185,13 +1582,42 @@ def process_getSchemaNames(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_getSchemaNamesV2(self, seqid, iprot, oprot): + args = getSchemaNamesV2_args() + args.read(iprot) + iprot.readMessageEnd() + result = getSchemaNamesV2_result() + try: + result.success = self._handler.getSchemaNamesV2(args.sessionId, args.catalogName) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except QueryProcessingException as error1: + msg_type = TMessageType.REPLY + result.error1 = error1 + except AccessDeniedException as error2: + msg_type = TMessageType.REPLY + result.error2 = error2 + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getSchemaNamesV2", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_getColumns(self, seqid, iprot, oprot): args = getColumns_args() args.read(iprot) iprot.readMessageEnd() result = getColumns_result() try: - result.success = self._handler.getColumns(args.sessionId, args.schema, args.table) + result.success = self._handler.getColumns(args.sessionId, args.catalogName, args.schema, args.table) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise @@ -1214,6 +1640,35 @@ def process_getColumns(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_getColumnsV2(self, seqid, iprot, oprot): + args = getColumnsV2_args() + args.read(iprot) + iprot.readMessageEnd() + result = getColumnsV2_result() + try: + result.success = self._handler.getColumnsV2(args.sessionId, args.catalogName, args.schema, args.table) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except QueryProcessingException as error1: + msg_type = TMessageType.REPLY + result.error1 = error1 + except AccessDeniedException as error2: + msg_type = TMessageType.REPLY + result.error2 = error2 + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getColumnsV2", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_updateUsers(self, seqid, iprot, oprot): args = updateUsers_args() args.read(iprot) @@ -1269,6 +1724,35 @@ def process_setProps(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_addCatalogs(self, seqid, iprot, oprot): + args = addCatalogs_args() + args.read(iprot) + iprot.readMessageEnd() + result = addCatalogs_result() + try: + self._handler.addCatalogs(args.sessionId, args.jsonString) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except QueryProcessingException as error1: + msg_type = TMessageType.REPLY + result.error1 = error1 + except AccessDeniedException as error2: + msg_type = TMessageType.REPLY + result.error2 = error2 + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("addCatalogs", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + # HELPER FUNCTIONS AND STRUCTURES @@ -1898,18 +2382,22 @@ def __ne__(self, other): ) -class explainAnalyze_args(object): +class dryRunV2_args(object): """ Attributes: - sessionId - - queryId + - catalogName + - sSchema + - sQueryString """ - def __init__(self, sessionId=None, queryId=None,): + def __init__(self, sessionId=None, catalogName=None, sSchema=None, sQueryString=None,): self.sessionId = sessionId - self.queryId = queryId + self.catalogName = catalogName + self.sSchema = sSchema + self.sQueryString = sQueryString def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -1927,7 +2415,17 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.queryId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.catalogName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.sSchema = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.sQueryString = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -1939,14 +2437,22 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('explainAnalyze_args') + oprot.writeStructBegin('dryRunV2_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) oprot.writeFieldEnd() - if self.queryId is not None: - oprot.writeFieldBegin('queryId', TType.STRING, 2) - oprot.writeString(self.queryId.encode('utf-8') if sys.version_info[0] == 2 else self.queryId) + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.sSchema is not None: + oprot.writeFieldBegin('sSchema', TType.STRING, 3) + oprot.writeString(self.sSchema.encode('utf-8') if sys.version_info[0] == 2 else self.sSchema) + oprot.writeFieldEnd() + if self.sQueryString is not None: + oprot.writeFieldBegin('sQueryString', TType.STRING, 4) + oprot.writeString(self.sQueryString.encode('utf-8') if sys.version_info[0] == 2 else self.sQueryString) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1964,15 +2470,17 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(explainAnalyze_args) -explainAnalyze_args.thrift_spec = ( +all_structs.append(dryRunV2_args) +dryRunV2_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 - (2, TType.STRING, 'queryId', 'UTF8', None, ), # 2 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'sSchema', 'UTF8', None, ), # 3 + (4, TType.STRING, 'sQueryString', 'UTF8', None, ), # 4 ) -class explainAnalyze_result(object): +class dryRunV2_result(object): """ Attributes: - success @@ -2020,7 +2528,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('explainAnalyze_result') + oprot.writeStructBegin('dryRunV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) @@ -2049,28 +2557,26 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(explainAnalyze_result) -explainAnalyze_result.thrift_spec = ( +all_structs.append(dryRunV2_result) +dryRunV2_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class prepareStatement_args(object): +class explainAnalyze_args(object): """ Attributes: - sessionId - - sSchemaName - - query + - queryId """ - def __init__(self, sessionId=None, sSchemaName=None, query=None,): + def __init__(self, sessionId=None, queryId=None,): self.sessionId = sessionId - self.sSchemaName = sSchemaName - self.query = query + self.queryId = queryId def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2088,12 +2594,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.sSchemaName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.query = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.queryId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2105,18 +2606,14 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('prepareStatement_args') + oprot.writeStructBegin('explainAnalyze_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) oprot.writeFieldEnd() - if self.sSchemaName is not None: - oprot.writeFieldBegin('sSchemaName', TType.STRING, 2) - oprot.writeString(self.sSchemaName.encode('utf-8') if sys.version_info[0] == 2 else self.sSchemaName) - oprot.writeFieldEnd() - if self.query is not None: - oprot.writeFieldBegin('query', TType.STRING, 3) - oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) + if self.queryId is not None: + oprot.writeFieldBegin('queryId', TType.STRING, 2) + oprot.writeString(self.queryId.encode('utf-8') if sys.version_info[0] == 2 else self.queryId) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2134,16 +2631,15 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(prepareStatement_args) -prepareStatement_args.thrift_spec = ( +all_structs.append(explainAnalyze_args) +explainAnalyze_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 - (2, TType.STRING, 'sSchemaName', 'UTF8', None, ), # 2 - (3, TType.STRING, 'query', 'UTF8', None, ), # 3 + (2, TType.STRING, 'queryId', 'UTF8', None, ), # 2 ) -class prepareStatement_result(object): +class explainAnalyze_result(object): """ Attributes: - success @@ -2191,7 +2687,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('prepareStatement_result') + oprot.writeStructBegin('explainAnalyze_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) @@ -2220,26 +2716,28 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(prepareStatement_result) -prepareStatement_result.thrift_spec = ( +all_structs.append(explainAnalyze_result) +explainAnalyze_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class executeStatement_args(object): +class prepareStatement_args(object): """ Attributes: - sessionId - - queryId + - sSchemaName + - query """ - def __init__(self, sessionId=None, queryId=None,): + def __init__(self, sessionId=None, sSchemaName=None, query=None,): self.sessionId = sessionId - self.queryId = queryId + self.sSchemaName = sSchemaName + self.query = query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2257,7 +2755,12 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.queryId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.sSchemaName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.query = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2269,14 +2772,18 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('executeStatement_args') + oprot.writeStructBegin('prepareStatement_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) oprot.writeFieldEnd() - if self.queryId is not None: - oprot.writeFieldBegin('queryId', TType.STRING, 2) - oprot.writeString(self.queryId.encode('utf-8') if sys.version_info[0] == 2 else self.queryId) + if self.sSchemaName is not None: + oprot.writeFieldBegin('sSchemaName', TType.STRING, 2) + oprot.writeString(self.sSchemaName.encode('utf-8') if sys.version_info[0] == 2 else self.sSchemaName) + oprot.writeFieldEnd() + if self.query is not None: + oprot.writeFieldBegin('query', TType.STRING, 3) + oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2294,24 +2801,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(executeStatement_args) -executeStatement_args.thrift_spec = ( +all_structs.append(prepareStatement_args) +prepareStatement_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 - (2, TType.STRING, 'queryId', 'UTF8', None, ), # 2 + (2, TType.STRING, 'sSchemaName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'query', 'UTF8', None, ), # 3 ) -class executeStatement_result(object): +class prepareStatement_result(object): """ Attributes: + - success - error1 - error2 """ - def __init__(self, error1=None, error2=None,): + def __init__(self, success=None, error1=None, error2=None,): + self.success = success self.error1 = error1 self.error2 = error2 @@ -2324,7 +2834,12 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break - if fid == 1: + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 1: if ftype == TType.STRUCT: self.error1 = QueryProcessingException.read(iprot) else: @@ -2343,7 +2858,11 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('executeStatement_result') + oprot.writeStructBegin('prepareStatement_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() if self.error1 is not None: oprot.writeFieldBegin('error1', TType.STRUCT, 1) self.error1.write(oprot) @@ -2368,26 +2887,30 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(executeStatement_result) -executeStatement_result.thrift_spec = ( - None, # 0 +all_structs.append(prepareStatement_result) +prepareStatement_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class getNextResultRow_args(object): +class prepareStatementV2_args(object): """ Attributes: - sessionId - - queryId + - catalogName + - sSchemaName + - query """ - def __init__(self, sessionId=None, queryId=None,): + def __init__(self, sessionId=None, catalogName=None, sSchemaName=None, query=None,): self.sessionId = sessionId - self.queryId = queryId + self.catalogName = catalogName + self.sSchemaName = sSchemaName + self.query = query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2405,7 +2928,17 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.queryId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.catalogName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.sSchemaName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.query = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2417,14 +2950,22 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getNextResultRow_args') + oprot.writeStructBegin('prepareStatementV2_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) oprot.writeFieldEnd() - if self.queryId is not None: - oprot.writeFieldBegin('queryId', TType.STRING, 2) - oprot.writeString(self.queryId.encode('utf-8') if sys.version_info[0] == 2 else self.queryId) + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.sSchemaName is not None: + oprot.writeFieldBegin('sSchemaName', TType.STRING, 3) + oprot.writeString(self.sSchemaName.encode('utf-8') if sys.version_info[0] == 2 else self.sSchemaName) + oprot.writeFieldEnd() + if self.query is not None: + oprot.writeFieldBegin('query', TType.STRING, 4) + oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2442,15 +2983,17 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getNextResultRow_args) -getNextResultRow_args.thrift_spec = ( +all_structs.append(prepareStatementV2_args) +prepareStatementV2_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 - (2, TType.STRING, 'queryId', 'UTF8', None, ), # 2 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'sSchemaName', 'UTF8', None, ), # 3 + (4, TType.STRING, 'query', 'UTF8', None, ), # 4 ) -class getNextResultRow_result(object): +class prepareStatementV2_result(object): """ Attributes: - success @@ -2476,7 +3019,7 @@ def read(self, iprot): break if fid == 0: if ftype == TType.STRING: - self.success = iprot.readBinary() + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: @@ -2498,10 +3041,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getNextResultRow_result') + oprot.writeStructBegin('prepareStatementV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeBinary(self.success) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.error1 is not None: oprot.writeFieldBegin('error1', TType.STRUCT, 1) @@ -2527,15 +3070,15 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getNextResultRow_result) -getNextResultRow_result.thrift_spec = ( - (0, TType.STRING, 'success', 'BINARY', None, ), # 0 +all_structs.append(prepareStatementV2_result) +prepareStatementV2_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class getNextResultBatch_args(object): +class executeStatement_args(object): """ Attributes: - sessionId @@ -2576,7 +3119,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getNextResultBatch_args') + oprot.writeStructBegin('executeStatement_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) @@ -2601,26 +3144,24 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getNextResultBatch_args) -getNextResultBatch_args.thrift_spec = ( +all_structs.append(executeStatement_args) +executeStatement_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 (2, TType.STRING, 'queryId', 'UTF8', None, ), # 2 ) -class getNextResultBatch_result(object): +class executeStatement_result(object): """ Attributes: - - success - error1 - error2 """ - def __init__(self, success=None, error1=None, error2=None,): - self.success = success + def __init__(self, error1=None, error2=None,): self.error1 = error1 self.error2 = error2 @@ -2633,12 +3174,7 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break - if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readBinary() - else: - iprot.skip(ftype) - elif fid == 1: + if fid == 1: if ftype == TType.STRUCT: self.error1 = QueryProcessingException.read(iprot) else: @@ -2657,11 +3193,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getNextResultBatch_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeBinary(self.success) - oprot.writeFieldEnd() + oprot.writeStructBegin('executeStatement_result') if self.error1 is not None: oprot.writeFieldBegin('error1', TType.STRUCT, 1) self.error1.write(oprot) @@ -2686,15 +3218,15 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getNextResultBatch_result) -getNextResultBatch_result.thrift_spec = ( - (0, TType.STRING, 'success', 'BINARY', None, ), # 0 +all_structs.append(executeStatement_result) +executeStatement_result.thrift_spec = ( + None, # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class getResultMetadata_args(object): +class getNextResultRow_args(object): """ Attributes: - sessionId @@ -2735,7 +3267,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getResultMetadata_args') + oprot.writeStructBegin('getNextResultRow_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) @@ -2760,15 +3292,15 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getResultMetadata_args) -getResultMetadata_args.thrift_spec = ( +all_structs.append(getNextResultRow_args) +getNextResultRow_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 (2, TType.STRING, 'queryId', 'UTF8', None, ), # 2 ) -class getResultMetadata_result(object): +class getNextResultRow_result(object): """ Attributes: - success @@ -2816,7 +3348,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getResultMetadata_result') + oprot.writeStructBegin('getNextResultRow_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeBinary(self.success) @@ -2845,26 +3377,26 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getResultMetadata_result) -getResultMetadata_result.thrift_spec = ( +all_structs.append(getNextResultRow_result) +getNextResultRow_result.thrift_spec = ( (0, TType.STRING, 'success', 'BINARY', None, ), # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class authenticate_args(object): +class getNextResultBatch_args(object): """ Attributes: - - user - - password + - sessionId + - queryId """ - def __init__(self, user=None, password=None,): - self.user = user - self.password = password + def __init__(self, sessionId=None, queryId=None,): + self.sessionId = sessionId + self.queryId = queryId def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2877,12 +3409,12 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.user = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.sessionId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.password = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.queryId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2894,14 +3426,14 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('authenticate_args') - if self.user is not None: - oprot.writeFieldBegin('user', TType.STRING, 1) - oprot.writeString(self.user.encode('utf-8') if sys.version_info[0] == 2 else self.user) + oprot.writeStructBegin('getNextResultBatch_args') + if self.sessionId is not None: + oprot.writeFieldBegin('sessionId', TType.STRING, 1) + oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) oprot.writeFieldEnd() - if self.password is not None: - oprot.writeFieldBegin('password', TType.STRING, 2) - oprot.writeString(self.password.encode('utf-8') if sys.version_info[0] == 2 else self.password) + if self.queryId is not None: + oprot.writeFieldBegin('queryId', TType.STRING, 2) + oprot.writeString(self.queryId.encode('utf-8') if sys.version_info[0] == 2 else self.queryId) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2919,26 +3451,28 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(authenticate_args) -authenticate_args.thrift_spec = ( +all_structs.append(getNextResultBatch_args) +getNextResultBatch_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'user', 'UTF8', None, ), # 1 - (2, TType.STRING, 'password', 'UTF8', None, ), # 2 + (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 + (2, TType.STRING, 'queryId', 'UTF8', None, ), # 2 ) -class authenticate_result(object): +class getNextResultBatch_result(object): """ Attributes: - success - - error + - error1 + - error2 """ - def __init__(self, success=None, error=None,): + def __init__(self, success=None, error1=None, error2=None,): self.success = success - self.error = error + self.error1 = error1 + self.error2 = error2 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2951,12 +3485,17 @@ def read(self, iprot): break if fid == 0: if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.success = iprot.readBinary() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.error = AccessDeniedException.read(iprot) + self.error1 = QueryProcessingException.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.error2 = AccessDeniedException.read(iprot) else: iprot.skip(ftype) else: @@ -2968,14 +3507,18 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('authenticate_result') + oprot.writeStructBegin('getNextResultBatch_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeBinary(self.success) oprot.writeFieldEnd() - if self.error is not None: - oprot.writeFieldBegin('error', TType.STRUCT, 1) - self.error.write(oprot) + if self.error1 is not None: + oprot.writeFieldBegin('error1', TType.STRUCT, 1) + self.error1.write(oprot) + oprot.writeFieldEnd() + if self.error2 is not None: + oprot.writeFieldBegin('error2', TType.STRUCT, 2) + self.error2.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2993,25 +3536,26 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(authenticate_result) -authenticate_result.thrift_spec = ( - (0, TType.STRING, 'success', 'UTF8', None, ), # 0 - (1, TType.STRUCT, 'error', [AccessDeniedException, None], None, ), # 1 +all_structs.append(getNextResultBatch_result) +getNextResultBatch_result.thrift_spec = ( + (0, TType.STRING, 'success', 'BINARY', None, ), # 0 + (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 + (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class getTables_args(object): +class getResultMetadata_args(object): """ Attributes: - sessionId - - schema + - queryId """ - def __init__(self, sessionId=None, schema=None,): + def __init__(self, sessionId=None, queryId=None,): self.sessionId = sessionId - self.schema = schema + self.queryId = queryId def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3029,7 +3573,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.schema = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.queryId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -3041,14 +3585,14 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getTables_args') + oprot.writeStructBegin('getResultMetadata_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) oprot.writeFieldEnd() - if self.schema is not None: - oprot.writeFieldBegin('schema', TType.STRING, 2) - oprot.writeString(self.schema.encode('utf-8') if sys.version_info[0] == 2 else self.schema) + if self.queryId is not None: + oprot.writeFieldBegin('queryId', TType.STRING, 2) + oprot.writeString(self.queryId.encode('utf-8') if sys.version_info[0] == 2 else self.queryId) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3066,15 +3610,15 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getTables_args) -getTables_args.thrift_spec = ( +all_structs.append(getResultMetadata_args) +getResultMetadata_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 - (2, TType.STRING, 'schema', 'UTF8', None, ), # 2 + (2, TType.STRING, 'queryId', 'UTF8', None, ), # 2 ) -class getTables_result(object): +class getResultMetadata_result(object): """ Attributes: - success @@ -3099,13 +3643,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.LIST: - self.success = [] - (_etype10, _size7) = iprot.readListBegin() - for _i11 in range(_size7): - _elem12 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() - self.success.append(_elem12) - iprot.readListEnd() + if ftype == TType.STRING: + self.success = iprot.readBinary() else: iprot.skip(ftype) elif fid == 1: @@ -3127,13 +3666,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getTables_result') + oprot.writeStructBegin('getResultMetadata_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.LIST, 0) - oprot.writeListBegin(TType.STRING, len(self.success)) - for iter13 in self.success: - oprot.writeString(iter13.encode('utf-8') if sys.version_info[0] == 2 else iter13) - oprot.writeListEnd() + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeBinary(self.success) oprot.writeFieldEnd() if self.error1 is not None: oprot.writeFieldBegin('error1', TType.STRUCT, 1) @@ -3159,24 +3695,845 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getTables_result) -getTables_result.thrift_spec = ( +all_structs.append(getResultMetadata_result) +getResultMetadata_result.thrift_spec = ( + (0, TType.STRING, 'success', 'BINARY', None, ), # 0 + (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 + (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 +) + + +class authenticate_args(object): + """ + Attributes: + - user + - password + + """ + + + def __init__(self, user=None, password=None,): + self.user = user + self.password = password + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.user = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.password = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('authenticate_args') + if self.user is not None: + oprot.writeFieldBegin('user', TType.STRING, 1) + oprot.writeString(self.user.encode('utf-8') if sys.version_info[0] == 2 else self.user) + oprot.writeFieldEnd() + if self.password is not None: + oprot.writeFieldBegin('password', TType.STRING, 2) + oprot.writeString(self.password.encode('utf-8') if sys.version_info[0] == 2 else self.password) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(authenticate_args) +authenticate_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'user', 'UTF8', None, ), # 1 + (2, TType.STRING, 'password', 'UTF8', None, ), # 2 +) + + +class authenticate_result(object): + """ + Attributes: + - success + - error + + """ + + + def __init__(self, success=None, error=None,): + self.success = success + self.error = error + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.error = AccessDeniedException.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('authenticate_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() + if self.error is not None: + oprot.writeFieldBegin('error', TType.STRUCT, 1) + self.error.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(authenticate_result) +authenticate_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 + (1, TType.STRUCT, 'error', [AccessDeniedException, None], None, ), # 1 +) + + +class getTables_args(object): + """ + Attributes: + - sessionId + - schema + + """ + + + def __init__(self, sessionId=None, schema=None,): + self.sessionId = sessionId + self.schema = schema + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.sessionId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.schema = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('getTables_args') + if self.sessionId is not None: + oprot.writeFieldBegin('sessionId', TType.STRING, 1) + oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) + oprot.writeFieldEnd() + if self.schema is not None: + oprot.writeFieldBegin('schema', TType.STRING, 2) + oprot.writeString(self.schema.encode('utf-8') if sys.version_info[0] == 2 else self.schema) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(getTables_args) +getTables_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 + (2, TType.STRING, 'schema', 'UTF8', None, ), # 2 +) + + +class getTables_result(object): + """ + Attributes: + - success + - error1 + - error2 + + """ + + + def __init__(self, success=None, error1=None, error2=None,): + self.success = success + self.error1 = error1 + self.error2 = error2 + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype10, _size7) = iprot.readListBegin() + for _i11 in range(_size7): + _elem12 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.success.append(_elem12) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.error1 = QueryProcessingException.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.error2 = AccessDeniedException.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('getTables_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter13 in self.success: + oprot.writeString(iter13.encode('utf-8') if sys.version_info[0] == 2 else iter13) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.error1 is not None: + oprot.writeFieldBegin('error1', TType.STRUCT, 1) + self.error1.write(oprot) + oprot.writeFieldEnd() + if self.error2 is not None: + oprot.writeFieldBegin('error2', TType.STRUCT, 2) + self.error2.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(getTables_result) +getTables_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 + (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 + (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 +) + + +class getTablesV2_args(object): + """ + Attributes: + - sessionId + - catalogName + - schema + + """ + + + def __init__(self, sessionId=None, catalogName=None, schema=None,): + self.sessionId = sessionId + self.catalogName = catalogName + self.schema = schema + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.sessionId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.catalogName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.schema = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('getTablesV2_args') + if self.sessionId is not None: + oprot.writeFieldBegin('sessionId', TType.STRING, 1) + oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) + oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.schema is not None: + oprot.writeFieldBegin('schema', TType.STRING, 3) + oprot.writeString(self.schema.encode('utf-8') if sys.version_info[0] == 2 else self.schema) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(getTablesV2_args) +getTablesV2_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'schema', 'UTF8', None, ), # 3 +) + + +class getTablesV2_result(object): + """ + Attributes: + - success + - error1 + - error2 + + """ + + + def __init__(self, success=None, error1=None, error2=None,): + self.success = success + self.error1 = error1 + self.error2 = error2 + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype17, _size14) = iprot.readListBegin() + for _i18 in range(_size14): + _elem19 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.success.append(_elem19) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.error1 = QueryProcessingException.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.error2 = AccessDeniedException.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('getTablesV2_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter20 in self.success: + oprot.writeString(iter20.encode('utf-8') if sys.version_info[0] == 2 else iter20) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.error1 is not None: + oprot.writeFieldBegin('error1', TType.STRUCT, 1) + self.error1.write(oprot) + oprot.writeFieldEnd() + if self.error2 is not None: + oprot.writeFieldBegin('error2', TType.STRUCT, 2) + self.error2.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(getTablesV2_result) +getTablesV2_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 + (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 + (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 +) + + +class getSchemaNames_args(object): + """ + Attributes: + - sessionId + + """ + + + def __init__(self, sessionId=None,): + self.sessionId = sessionId + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.sessionId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('getSchemaNames_args') + if self.sessionId is not None: + oprot.writeFieldBegin('sessionId', TType.STRING, 1) + oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(getSchemaNames_args) +getSchemaNames_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 +) + + +class getSchemaNames_result(object): + """ + Attributes: + - success + - error1 + - error2 + + """ + + + def __init__(self, success=None, error1=None, error2=None,): + self.success = success + self.error1 = error1 + self.error2 = error2 + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype24, _size21) = iprot.readListBegin() + for _i25 in range(_size21): + _elem26 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.success.append(_elem26) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.error1 = QueryProcessingException.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.error2 = AccessDeniedException.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('getSchemaNames_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter27 in self.success: + oprot.writeString(iter27.encode('utf-8') if sys.version_info[0] == 2 else iter27) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.error1 is not None: + oprot.writeFieldBegin('error1', TType.STRUCT, 1) + self.error1.write(oprot) + oprot.writeFieldEnd() + if self.error2 is not None: + oprot.writeFieldBegin('error2', TType.STRUCT, 2) + self.error2.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(getSchemaNames_result) +getSchemaNames_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 + (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 + (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 +) + + +class getSchemaNamesV2_args(object): + """ + Attributes: + - sessionId + - catalogName + + """ + + + def __init__(self, sessionId=None, catalogName=None,): + self.sessionId = sessionId + self.catalogName = catalogName + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.sessionId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.catalogName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('getSchemaNamesV2_args') + if self.sessionId is not None: + oprot.writeFieldBegin('sessionId', TType.STRING, 1) + oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) + oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(getSchemaNamesV2_args) +getSchemaNamesV2_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 +) + + +class getSchemaNamesV2_result(object): + """ + Attributes: + - success + - error1 + - error2 + + """ + + + def __init__(self, success=None, error1=None, error2=None,): + self.success = success + self.error1 = error1 + self.error2 = error2 + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype31, _size28) = iprot.readListBegin() + for _i32 in range(_size28): + _elem33 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.success.append(_elem33) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.error1 = QueryProcessingException.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.error2 = AccessDeniedException.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('getSchemaNamesV2_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter34 in self.success: + oprot.writeString(iter34.encode('utf-8') if sys.version_info[0] == 2 else iter34) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.error1 is not None: + oprot.writeFieldBegin('error1', TType.STRUCT, 1) + self.error1.write(oprot) + oprot.writeFieldEnd() + if self.error2 is not None: + oprot.writeFieldBegin('error2', TType.STRUCT, 2) + self.error2.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(getSchemaNamesV2_result) +getSchemaNamesV2_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class getSchemaNames_args(object): +class getColumns_args(object): """ Attributes: - sessionId + - catalogName + - schema + - table """ - def __init__(self, sessionId=None,): + def __init__(self, sessionId=None, catalogName=None, schema=None, table=None,): self.sessionId = sessionId + self.catalogName = catalogName + self.schema = schema + self.table = table def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3192,6 +4549,21 @@ def read(self, iprot): self.sessionId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.catalogName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.schema = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.table = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -3201,11 +4573,23 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getSchemaNames_args') + oprot.writeStructBegin('getColumns_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.schema is not None: + oprot.writeFieldBegin('schema', TType.STRING, 3) + oprot.writeString(self.schema.encode('utf-8') if sys.version_info[0] == 2 else self.schema) + oprot.writeFieldEnd() + if self.table is not None: + oprot.writeFieldBegin('table', TType.STRING, 4) + oprot.writeString(self.table.encode('utf-8') if sys.version_info[0] == 2 else self.table) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3222,14 +4606,17 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getSchemaNames_args) -getSchemaNames_args.thrift_spec = ( +all_structs.append(getColumns_args) +getColumns_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'schema', 'UTF8', None, ), # 3 + (4, TType.STRING, 'table', 'UTF8', None, ), # 4 ) -class getSchemaNames_result(object): +class getColumns_result(object): """ Attributes: - success @@ -3256,10 +4643,11 @@ def read(self, iprot): if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype17, _size14) = iprot.readListBegin() - for _i18 in range(_size14): - _elem19 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() - self.success.append(_elem19) + (_etype38, _size35) = iprot.readListBegin() + for _i39 in range(_size35): + _elem40 = TFieldInfo() + _elem40.read(iprot) + self.success.append(_elem40) iprot.readListEnd() else: iprot.skip(ftype) @@ -3282,12 +4670,12 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getSchemaNames_result') + oprot.writeStructBegin('getColumns_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) - oprot.writeListBegin(TType.STRING, len(self.success)) - for iter20 in self.success: - oprot.writeString(iter20.encode('utf-8') if sys.version_info[0] == 2 else iter20) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter41 in self.success: + iter41.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.error1 is not None: @@ -3314,26 +4702,28 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getSchemaNames_result) -getSchemaNames_result.thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 +all_structs.append(getColumns_result) +getColumns_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [TFieldInfo, None], False), None, ), # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 ) -class getColumns_args(object): +class getColumnsV2_args(object): """ Attributes: - sessionId + - catalogName - schema - table """ - def __init__(self, sessionId=None, schema=None, table=None,): + def __init__(self, sessionId=None, catalogName=None, schema=None, table=None,): self.sessionId = sessionId + self.catalogName = catalogName self.schema = schema self.table = table @@ -3353,10 +4743,15 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.schema = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + self.catalogName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: + if ftype == TType.STRING: + self.schema = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: if ftype == TType.STRING: self.table = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: @@ -3370,17 +4765,21 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getColumns_args') + oprot.writeStructBegin('getColumnsV2_args') if self.sessionId is not None: oprot.writeFieldBegin('sessionId', TType.STRING, 1) oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() if self.schema is not None: - oprot.writeFieldBegin('schema', TType.STRING, 2) + oprot.writeFieldBegin('schema', TType.STRING, 3) oprot.writeString(self.schema.encode('utf-8') if sys.version_info[0] == 2 else self.schema) oprot.writeFieldEnd() if self.table is not None: - oprot.writeFieldBegin('table', TType.STRING, 3) + oprot.writeFieldBegin('table', TType.STRING, 4) oprot.writeString(self.table.encode('utf-8') if sys.version_info[0] == 2 else self.table) oprot.writeFieldEnd() oprot.writeFieldStop() @@ -3399,16 +4798,17 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getColumns_args) -getColumns_args.thrift_spec = ( +all_structs.append(getColumnsV2_args) +getColumnsV2_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 - (2, TType.STRING, 'schema', 'UTF8', None, ), # 2 - (3, TType.STRING, 'table', 'UTF8', None, ), # 3 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'schema', 'UTF8', None, ), # 3 + (4, TType.STRING, 'table', 'UTF8', None, ), # 4 ) -class getColumns_result(object): +class getColumnsV2_result(object): """ Attributes: - success @@ -3435,11 +4835,11 @@ def read(self, iprot): if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype24, _size21) = iprot.readListBegin() - for _i25 in range(_size21): - _elem26 = TFieldInfo() - _elem26.read(iprot) - self.success.append(_elem26) + (_etype45, _size42) = iprot.readListBegin() + for _i46 in range(_size42): + _elem47 = TFieldInfo() + _elem47.read(iprot) + self.success.append(_elem47) iprot.readListEnd() else: iprot.skip(ftype) @@ -3462,12 +4862,12 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('getColumns_result') + oprot.writeStructBegin('getColumnsV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter27 in self.success: - iter27.write(oprot) + for iter48 in self.success: + iter48.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.error1 is not None: @@ -3494,8 +4894,8 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(getColumns_result) -getColumns_result.thrift_spec = ( +all_structs.append(getColumnsV2_result) +getColumnsV2_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TFieldInfo, None], False), None, ), # 0 (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 @@ -3772,5 +5172,153 @@ def __ne__(self, other): None, # 0 (1, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 1 ) + + +class addCatalogs_args(object): + """ + Attributes: + - sessionId + - jsonString + + """ + + + def __init__(self, sessionId=None, jsonString=None,): + self.sessionId = sessionId + self.jsonString = jsonString + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.sessionId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.jsonString = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('addCatalogs_args') + if self.sessionId is not None: + oprot.writeFieldBegin('sessionId', TType.STRING, 1) + oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId) + oprot.writeFieldEnd() + if self.jsonString is not None: + oprot.writeFieldBegin('jsonString', TType.STRING, 2) + oprot.writeString(self.jsonString.encode('utf-8') if sys.version_info[0] == 2 else self.jsonString) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(addCatalogs_args) +addCatalogs_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'sessionId', 'UTF8', None, ), # 1 + (2, TType.STRING, 'jsonString', 'UTF8', None, ), # 2 +) + + +class addCatalogs_result(object): + """ + Attributes: + - error1 + - error2 + + """ + + + def __init__(self, error1=None, error2=None,): + self.error1 = error1 + self.error2 = error2 + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.error1 = QueryProcessingException.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.error2 = AccessDeniedException.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('addCatalogs_result') + if self.error1 is not None: + oprot.writeFieldBegin('error1', TType.STRUCT, 1) + self.error1.write(oprot) + oprot.writeFieldEnd() + if self.error2 is not None: + oprot.writeFieldBegin('error2', TType.STRUCT, 2) + self.error2.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(addCatalogs_result) +addCatalogs_result.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'error1', [QueryProcessingException, None], None, ), # 1 + (2, TType.STRUCT, 'error2', [AccessDeniedException, None], None, ), # 2 +) fix_spec(all_structs) del all_structs diff --git a/server.thrift b/server.thrift index 6e0e35c..7d58217 100644 --- a/server.thrift +++ b/server.thrift @@ -35,10 +35,14 @@ service QueryEngineService string dryRun(1: string sessionId, 2: string sSchema, 3: string sQueryString) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), // Executor, Engine + string dryRunV2(1: string sessionId, 2: string catalogName, 3: string sSchema, 4: string sQueryString) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), // Executor, Engine + string explainAnalyze(1: string sessionId, 2: string queryId) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), // Executor, Engine string prepareStatement(1: string sessionId, 2: string sSchemaName, 3: string query) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), + string prepareStatementV2(1: string sessionId, 2: string catalogName, 3: string sSchemaName, 4: string query) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), + void executeStatement(1: string sessionId, 2: string queryId) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), binary getNextResultRow(1: string sessionId, 2: string queryId) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), @@ -51,11 +55,20 @@ service QueryEngineService list getTables(1: string sessionId, 2: string schema) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), + list getTablesV2(1: string sessionId, 2: string catalogName, 3:string schema) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), + list getSchemaNames(1: string sessionId) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), - list getColumns(1: string sessionId, 2: string schema, 3: string table) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), + list getSchemaNamesV2(1: string sessionId,2: string catalogName) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), + + list getColumns(1: string sessionId,2: string catalogName, 3: string schema, 4: string table) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), + + list getColumnsV2(1: string sessionId,2: string catalogName, 3: string schema, 4: string table) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), void updateUsers(1: binary userInfo) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), void setProps(1: string sessionId, 2: string propMap) throws (1: AccessDeniedException error2), + + void addCatalogs(1: string sessionId, 2: string jsonString) throws (1: QueryProcessingException error1, 2: AccessDeniedException error2), + } \ No newline at end of file diff --git a/setup.py b/setup.py index a42bc37..d3646d1 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ envstring = lambda var: os.environ.get(var) or "" -VERSION = [1, 0, 4] +VERSION = [1, 0, 5] def get_long_desc():