def execute_query_statement(self, sql, timeout=0): """ execute query sql statement and returns SessionDataSet :param sql: String, query sql statement :return: SessionDataSet, contains query results and relevant info (see SessionDataSet.py) """ request = TSExecuteStatementReq(self.__session_id, sql, self.__statement_id, self.__fetch_size, timeout) resp = self.__client.executeQueryStatement(request) return SessionDataSet( sql, resp.columns, resp.dataTypeList, resp.columnNameIndexMap, resp.queryId, self.__client, self.__session_id, resp.queryDataSet, resp.ignoreTimeStamp, )
def execute_raw_data_query(self, paths: list, start_time: int, end_time: int) -> SessionDataSet: request = TSRawDataQueryReq( self.__session_id, paths, self.__fetch_size, startTime=start_time, endTime=end_time, statementId=self.__statement_id, enableRedirectQuery=False, ) resp = self.__client.executeRawDataQuery(request) return SessionDataSet( "", resp.columns, resp.dataTypeList, resp.columnNameIndexMap, resp.queryId, self.__client, self.__statement_id, self.__session_id, resp.queryDataSet, resp.ignoreTimeStamp, )