diff --git a/MLPipeline_test.py b/MLPipeline_test.py new file mode 100644 index 0000000..fdb0eec --- /dev/null +++ b/MLPipeline_test.py @@ -0,0 +1,38 @@ +from unittest import TestCase +from e6data_python_connector import Connection + +import logging + +logging.getLogger(__name__) +logging.basicConfig(level=logging.DEBUG) + +class TestDataFrame(TestCase): + def setUp(self) -> None: + self._host = "localhost" + self._catalog = "demogluecatalog" + self._database = "ml_expts" + logging.debug('Trying to connect to engine') + self.e6x_connection = Connection( + host=self._host, + port=9001, + username='sweta@e6x.io', + password='Dummy@123', + database=self._database, + catalog=self._catalog + ) + logging.debug('Successfully connect to engine.') + + def disconnect(self): + self.e6x_connection.close() + self.assertFalse(self.e6x_connection.check_connection()) + + def tearDown(self) -> None: + self.disconnect() + + def test_mlpipeline(self): + self._mlPipeline = self.createMLPipeline() + self._mlPipeline.train_linear_model("select * from ml_expts.boston_housing") + self._mlPipeline.train_linear_model("select * from ml_expts.boston_housing") + + self._mlPipeline.execute() + diff --git a/MatrixTest.py b/MatrixTest.py new file mode 100644 index 0000000..1bc5214 --- /dev/null +++ b/MatrixTest.py @@ -0,0 +1,57 @@ +from unittest import TestCase +from e6data_python_connector import Connection +import numpy as np + +import logging + +from e6data_python_connector.e6data_grpc import Matrix + +logging.getLogger(__name__) +logging.basicConfig(level=logging.DEBUG) + +class MatrixTest(TestCase): + def setUp(self) -> None: + self._host = "localhost" + self._catalog = "demogluecatalog" + self._database = "ml_expts" + logging.debug('Trying to connect to engine') + self.e6x_connection = Connection( + host=self._host, + port=9020, + username='sweta@e6x.io', + password='Dummy@123', + database=self._database, + catalog=self._catalog + ) + self.matrix_ops = Matrix(self.e6x_connection) + logging.debug('Successfully connect to engine.') + + def disconnect(self): + self.e6x_connection.close() + self.assertFalse(self.e6x_connection.check_connection()) + + def tearDown(self) -> None: + self.disconnect() + + def test_matrixCompute(self): + matrix1 = [[1, 2], [3, 4]] + matrix2 = [[5, 6], [7, 8]] + + print("Matrix1: ", matrix1) + print("Matrix2: ", matrix2) + + # Matrix Multiplication + print("Matrix Multiplication:") + self.matrix_ops.matmul(matrix1, matrix2) + + # Matrix Addition + print("Matrix Addition:") + self.matrix_ops.add(matrix1, matrix2) + + # Matrix Transpose + print("Matrix Transpose:") + self.matrix_ops.transpose(matrix1) + + # Matrix Inverse + print("Matrix Inverse:") + self.matrix_ops.inverse(matrix1) diff --git a/e6data_python_connector/date_time_utils.py b/e6data_python_connector/date_time_utils.py index 6ce7f10..eb2bf33 100644 --- a/e6data_python_connector/date_time_utils.py +++ b/e6data_python_connector/date_time_utils.py @@ -1,138 +1,6 @@ from typing import Final import pytz -TIME_ZONES = { - "+12:00": ["Pacific/Kwajalein", "Pacific/Wallis", "Pacific/Funafuti", "Pacific/Nauru", "Kwajalein", "Pacific/Wake", - "Pacific/Norfolk", "Pacific/Tarawa", "Asia/Kamchatka", "Etc/GMT-12", "Asia/Anadyr", "Pacific/Majuro", ], - "+14:00": ["Pacific/Kiritimati", "Etc/GMT-14", ], - "UTC": ["UTC"], - "-01:00": ["Etc/GMT+1", "Atlantic/Cape_Verde", "Atlantic/Azores", "America/Scoresbysund", ], - "-03:00": ["Chile/Continental", "America/Miquelon", "America/Argentina/Catamarca", "America/Argentina/Cordoba", - "America/Araguaina", "America/Argentina/Salta", "Etc/GMT+3", "America/Montevideo", "Brazil/East", - "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Catamarca", "America/Godthab", - "America/Cordoba", "America/Sao_Paulo", "America/Argentina/Jujuy", "America/Cayenne", "America/Recife", - "America/Buenos_Aires", "America/Paramaribo", "America/Mendoza", "America/Santarem", "America/Asuncion", - "America/Maceio", "Atlantic/Stanley", "Antarctica/Rothera", "America/Argentina/San_Luis", - "America/Santiago", "America/Argentina/Ushuaia", "Antarctica/Palmer", "America/Punta_Arenas", - "America/Fortaleza", "America/Argentina/La_Rioja", "America/Belem", "America/Jujuy", "America/Bahia", - "America/Argentina/San_Juan", "America/Argentina/ComodRivadavia", "America/Argentina/Tucuman", - "America/Nuuk", "America/Rosario", "America/Argentina/Buenos_Aires", ], - "-09:00": ["Etc/GMT+9", "US/Alaska", "America/Juneau", "America/Metlakatla", "Pacific/Gambier", "America/Yakutat", - "America/Sitka", "SystemV/YST9", "America/Anchorage", "America/Nome", "SystemV/YST9YDT", ], - "-07:00": ["Canada/Yukon", "Etc/GMT+7", "US/Arizona", "Mexico/BajaSur", "America/Dawson_Creek", "America/Denver", - "America/Yellowknife", "America/Inuvik", "America/Mazatlan", "SystemV/MST7", "America/Boise", - "America/Dawson", "MST7MDT", "America/Chihuahua", "America/Ojinaga", "US/Mountain", "America/Creston", - "America/Edmonton", "America/Hermosillo", "Canada/Mountain", "America/Cambridge_Bay", "Navajo", - "America/Phoenix", "America/Whitehorse", "SystemV/MST7MDT", "America/Fort_Nelson", "America/Shiprock", ], - "-05:00": ["America/Panama", "America/Indiana/Petersburg", "America/Eirunepe", "America/Grand_Turk", "Cuba", - "Etc/GMT+5", "Pacific/Easter", "America/Fort_Wayne", "America/Havana", "America/Porto_Acre", - "US/Michigan", "America/Louisville", "America/Guayaquil", "America/Indiana/Vevay", - "America/Indiana/Vincennes", "America/Indianapolis", "America/Iqaluit", "America/Kentucky/Louisville", - "EST5EDT", "America/Nassau", "America/Jamaica", "America/Atikokan", "America/Kentucky/Monticello", - "America/Coral_Harbour", "America/Cayman", "Chile/EasterIsland", "America/Indiana/Indianapolis", - "America/Thunder_Bay", "America/Indiana/Marengo", "America/Bogota", "SystemV/EST5", "US/Eastern", - "Canada/Eastern", "America/Port-au-Prince", "America/Nipigon", "Brazil/Acre", "US/East-Indiana", - "America/Cancun", "America/Lima", "America/Rio_Branco", "America/Detroit", "Jamaica", - "America/Pangnirtung", "America/Montreal", "America/Indiana/Winamac", "America/New_York", - "America/Toronto", "SystemV/EST5EDT", ], - "+03:00": ["Asia/Aden", "Africa/Nairobi", "Europe/Istanbul", "Etc/GMT-3", "Indian/Comoro", "Antarctica/Syowa", - "Africa/Mogadishu", "Africa/Asmera", "Asia/Istanbul", "Europe/Moscow", "Africa/Djibouti", - "Europe/Simferopol", "Africa/Asmara", "Asia/Baghdad", "Africa/Dar_es_Salaam", "Africa/Addis_Ababa", - "Asia/Riyadh", "Asia/Kuwait", "Europe/Kirov", "Africa/Kampala", "Europe/Minsk", "Asia/Qatar", - "Asia/Bahrain", "Indian/Antananarivo", "Indian/Mayotte", "Europe/Volgograd", "Turkey", "W-SU", ], - "+01:00": ["Europe/Brussels", "Europe/Warsaw", "CET", "Etc/GMT-1", "Europe/Luxembourg", "Africa/Tunis", - "Europe/Malta", "Europe/Busingen", "Africa/Malabo", "Europe/Skopje", "Europe/Sarajevo", "Africa/Lagos", - "Europe/Rome", "Africa/Algiers", "Europe/Zurich", "Europe/Gibraltar", "Europe/Vaduz", "Europe/Ljubljana", - "Europe/Berlin", "Europe/Stockholm", "Europe/Budapest", "Europe/Zagreb", "Europe/Paris", - "Africa/Ndjamena", "Africa/Ceuta", "Europe/Prague", "Europe/Copenhagen", "Europe/Vienna", - "Europe/Tirane", "MET", "Europe/Amsterdam", "Africa/Libreville", "Africa/El_Aaiun", "Europe/San_Marino", - "Africa/Douala", "Africa/Brazzaville", "Africa/Porto-Novo", "Poland", "Europe/Andorra", "Europe/Oslo", - "Europe/Podgorica", "Africa/Casablanca", "Africa/Luanda", "Atlantic/Jan_Mayen", "Africa/Kinshasa", - "Europe/Madrid", "Africa/Bangui", "Europe/Belgrade", "Africa/Niamey", "Europe/Bratislava", - "Arctic/Longyearbyen", "Europe/Vatican", "Europe/Monaco", ], - "+04:30": ["Asia/Kabul", ], - "+07:00": ["Asia/Pontianak", "Etc/GMT-7", "Asia/Phnom_Penh", "Asia/Novosibirsk", "Antarctica/Davis", "Asia/Tomsk", - "Asia/Jakarta", "Asia/Barnaul", "Indian/Christmas", "Asia/Ho_Chi_Minh", "Asia/Hovd", "Asia/Bangkok", - "Asia/Vientiane", "Asia/Novokuznetsk", "Asia/Krasnoyarsk", "Asia/Saigon", ], - "+05:45": ["Asia/Kathmandu", "Asia/Katmandu", ], - "+05:00": ["Asia/Aqtau", "Etc/GMT-5", "Asia/Samarkand", "Asia/Karachi", "Asia/Yekaterinburg", "Asia/Dushanbe", - "Indian/Maldives", "Asia/Oral", "Asia/Tashkent", "Antarctica/Mawson", "Asia/Qyzylorda", "Asia/Aqtobe", - "Asia/Ashkhabad", "Asia/Ashgabat", "Asia/Atyrau", "Indian/Kerguelen", ], - "+06:30": ["Asia/Yangon", "Asia/Rangoon", "Indian/Cocos", ], - "+10:00": ["Pacific/Yap", "Pacific/Port_Moresby", "Pacific/Chuuk", "Australia/Queensland", "Pacific/Guam", - "Pacific/Truk", "Asia/Vladivostok", "Pacific/Saipan", "Antarctica/DumontDUrville", "Australia/Brisbane", - "Etc/GMT-10", "Asia/Ust-Nera", "Australia/Lindeman", ], - "+09:00": ["Etc/GMT-9", "Pacific/Palau", "Asia/Chita", "Asia/Dili", "Asia/Jayapura", "Asia/Yakutsk", - "Asia/Pyongyang", "ROK", "Asia/Seoul", "Asia/Khandyga", "Japan", "Asia/Tokyo", ], - "Z": ["UTC", "Europe/London", "GMT", "Etc/GMT-0", "Europe/Jersey", "Atlantic/St_Helena", "Europe/Guernsey", - "Europe/Isle_of_Man", "Etc/GMT+0", "Africa/Banjul", "Etc/GMT", "Africa/Freetown", "GB-Eire", "Africa/Bamako", - "GB", "Africa/Conakry", "Portugal", "Universal", "Africa/Sao_Tome", "Africa/Nouakchott", "Antarctica/Troll", - "UTC", "Etc/Universal", "Atlantic/Faeroe", "Africa/Abidjan", "Eire", "Africa/Accra", "Atlantic/Faroe", - "Etc/UCT", "GMT0", "Europe/Dublin", "Zulu", "Africa/Ouagadougou", "Atlantic/Reykjavik", "Atlantic/Madeira", - "Etc/Zulu", "Iceland", "Europe/Lisbon", "Atlantic/Canary", "Africa/Lome", "Greenwich", "Europe/Belfast", - "Etc/GMT0", "America/Danmarkshavn", "Africa/Dakar", "Africa/Bissau", "WET", "Etc/Greenwich", - "Africa/Timbuktu", "UCT", "Africa/Monrovia", "Etc/UTC", ], - "-11:00": ["Pacific/Pago_Pago", "Pacific/Samoa", "Pacific/Niue", "US/Samoa", "Etc/GMT+11", "Pacific/Midway", ], - "-06:00": ["America/El_Salvador", "America/Guatemala", "America/Belize", "America/Managua", "America/Chicago", - "America/Tegucigalpa", "Etc/GMT+6", "America/Regina", "Mexico/General", "America/Rankin_Inlet", - "US/Central", "Pacific/Galapagos", "America/Rainy_River", "America/Swift_Current", "America/Costa_Rica", - "America/Indiana/Knox", "America/North_Dakota/Beulah", "America/Monterrey", "SystemV/CST6", - "America/North_Dakota/Center", "America/Indiana/Tell_City", "America/Mexico_City", "America/Matamoros", - "CST6CDT", "America/Knox_IN", "America/Menominee", "America/Resolute", "Canada/Central", - "America/Bahia_Banderas", "US/Indiana-Starke", "SystemV/CST6CDT", "America/Merida", - "Canada/Saskatchewan", "America/North_Dakota/New_Salem", "America/Winnipeg", ], - "-03:30": ["America/St_Johns", "Canada/Newfoundland", ], - "+13:45": ["NZ-CHAT", "Pacific/Chatham", ], - "+10:30": ["Australia/Yancowinna", "Australia/Adelaide", "Australia/Broken_Hill", "Australia/South", ], - "+11:00": ["Australia/Hobart", "Australia/Tasmania", "Australia/ACT", "Pacific/Ponape", "Pacific/Bougainville", - "Australia/Victoria", "Antarctica/Macquarie", "Antarctica/Casey", "Australia/Canberra", - "Australia/Currie", "Australia/Lord_Howe", "Australia/NSW", "Pacific/Pohnpei", "Pacific/Efate", - "Asia/Magadan", "Pacific/Kosrae", "Australia/Sydney", "Australia/LHI", "Asia/Sakhalin", "Pacific/Noumea", - "Etc/GMT-11", "Asia/Srednekolymsk", "Australia/Melbourne", "Pacific/Guadalcanal", ], - "+13:00": ["Pacific/Fakaofo", "Antarctica/McMurdo", "Pacific/Fiji", "Pacific/Enderbury", "NZ", "Pacific/Apia", - "Antarctica/South_Pole", "Pacific/Kanton", "Pacific/Auckland", "Pacific/Tongatapu", "Etc/GMT-13", ], - "-09:30": ["Pacific/Marquesas", ], - "-08:00": ["Etc/GMT+8", "Canada/Pacific", "PST8PDT", "Pacific/Pitcairn", "Mexico/BajaNorte", "America/Tijuana", - "SystemV/PST8", "America/Santa_Isabel", "America/Vancouver", "America/Ensenada", "SystemV/PST8PDT", - "America/Los_Angeles", "US/Pacific", ], - "-02:00": ["Etc/GMT+2", "America/Noronha", "Brazil/DeNoronha", "Atlantic/South_Georgia", ], - "-04:00": ["America/Cuiaba", "America/Marigot", "Canada/Atlantic", "Etc/GMT+4", "America/Manaus", - "America/St_Thomas", "America/Anguilla", "America/Barbados", "America/Curacao", "America/Guyana", - "America/Martinique", "America/Puerto_Rico", "America/Port_of_Spain", "SystemV/AST4", - "America/Kralendijk", "America/Antigua", "America/Moncton", "America/St_Vincent", "America/Dominica", - "Atlantic/Bermuda", "Brazil/West", "America/Aruba", "America/Halifax", "America/La_Paz", - "America/Blanc-Sablon", "America/Santo_Domingo", "America/Glace_Bay", "America/St_Barthelemy", - "America/St_Lucia", "America/Montserrat", "America/Lower_Princes", "America/Thule", "America/Tortola", - "America/Porto_Velho", "America/Campo_Grande", "America/Goose_Bay", "America/Virgin", - "America/Boa_Vista", "America/Grenada", "America/St_Kitts", "America/Caracas", "America/Guadeloupe", - "SystemV/AST4ADT", ], - "+02:00": ["Africa/Cairo", "Africa/Mbabane", "Etc/GMT-2", "Europe/Zaporozhye", "Libya", "Africa/Kigali", - "Africa/Tripoli", "Israel", "Europe/Kaliningrad", "Africa/Windhoek", "Europe/Bucharest", - "Europe/Mariehamn", "Africa/Lubumbashi", "Europe/Tiraspol", "Europe/Chisinau", "Europe/Helsinki", - "Asia/Beirut", "Asia/Tel_Aviv", "Europe/Sofia", "Africa/Gaborone", "Asia/Gaza", "Europe/Riga", - "Africa/Maputo", "Asia/Damascus", "Europe/Uzhgorod", "Asia/Jerusalem", "Africa/Bujumbura", "Europe/Kiev", - "Europe/Vilnius", "Africa/Maseru", "Africa/Blantyre", "Africa/Lusaka", "Africa/Harare", "Europe/Tallinn", - "Africa/Khartoum", "Africa/Johannesburg", "Africa/Juba", "Asia/Nicosia", "Asia/Famagusta", "EET", - "Asia/Hebron", "Egypt", "Asia/Amman", "Europe/Nicosia", "Europe/Athens", ], - "+03:30": ["Iran", "Asia/Tehran", ], - "+04:00": ["Asia/Yerevan", "Etc/GMT-4", "Asia/Dubai", "Indian/Reunion", "Indian/Mauritius", "Europe/Saratov", - "Europe/Samara", "Indian/Mahe", "Asia/Baku", "Asia/Muscat", "Europe/Astrakhan", "Asia/Tbilisi", - "Europe/Ulyanovsk", ], - "+06:00": ["Asia/Kashgar", "Etc/GMT-6", "Asia/Almaty", "Asia/Dacca", "Asia/Omsk", "Asia/Dhaka", "Indian/Chagos", - "Asia/Qostanay", "Asia/Bishkek", "Antarctica/Vostok", "Asia/Urumqi", "Asia/Thimbu", "Asia/Thimphu", ], - "+08:45": ["Australia/Eucla", ], - "+08:00": ["Asia/Kuching", "Asia/Chungking", "Etc/GMT-8", "Australia/Perth", "Asia/Macao", "Asia/Macau", - "Asia/Choibalsan", "Asia/Shanghai", "Asia/Ulan_Bator", "Asia/Chongqing", "Asia/Ulaanbaatar", - "Asia/Taipei", "Asia/Manila", "PRC", "Asia/Ujung_Pandang", "Asia/Harbin", "Singapore", "Asia/Brunei", - "Australia/West", "Asia/Hong_Kong", "Asia/Makassar", "Hongkong", "Asia/Kuala_Lumpur", "Asia/Irkutsk", - "Asia/Singapore", ], - "-12:00": ["Etc/GMT+12", ], - "+05:30": ["Asia/Kolkata", "Asia/Colombo", "Asia/Calcutta", ], - "+09:30": ["Australia/North", "Australia/Darwin", ], - "-10:00": ["Pacific/Honolulu", "Pacific/Rarotonga", "Pacific/Tahiti", "Pacific/Johnston", "America/Atka", - "US/Hawaii", "SystemV/HST10", "America/Adak", "US/Aleutian", "Etc/GMT+10", ], - -} FORMATS = { "yyyy": "%Y", @@ -182,9 +50,3 @@ def get_format(str_format): if str_format is None or len(str_format) == 0: return "%Y-%m-%d %H:%M:%S" return FORMATS[str_format] - - -def get_zone(zone): - if zone is None or len(zone) == 0: - return "UTC" - return TIME_ZONES[zone][0] diff --git a/e6data_python_connector/e6data_grpc.py b/e6data_python_connector/e6data_grpc.py index 997640d..801e49a 100644 --- a/e6data_python_connector/e6data_grpc.py +++ b/e6data_python_connector/e6data_grpc.py @@ -14,6 +14,7 @@ from decimal import Decimal from io import BytesIO from ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED +import numpy as np import grpc from grpc._channel import _InactiveRpcError @@ -24,6 +25,7 @@ from e6data_python_connector.datainputstream import get_query_columns_info, read_rows_from_chunk from e6data_python_connector.server import e6x_engine_pb2_grpc, e6x_engine_pb2 from e6data_python_connector.typeId import * +from abc import ABC apilevel = '2.0' threadsafety = 2 # Threads may share the e6xdb and connections. @@ -38,6 +40,23 @@ "optional": CERT_OPTIONAL, "required": CERT_REQUIRED, } +MAX_RETRY = 1 + + +def _retry(obj, func_name, retry_counter=0, *args): + try: + return getattr(obj, func_name)(*args) + except _InactiveRpcError as e: + if (e.code() == grpc.StatusCode.INTERNAL and 'Access denied. Invalid session' in e.details() and + retry_counter < MAX_RETRY): + getattr(obj, "reset_connection")() + return _retry(obj, func_name, retry_counter + 1, *args) + + +class RetryableConnection(ABC): + + def reset_session(self): + raise NotImplementedError() def _parse_timestamp(value): @@ -102,7 +121,7 @@ def connect(*args, **kwargs): return Connection(*args, **kwargs) -class Connection(object): +class Connection(RetryableConnection): """Create connection to e6data """ def __init__( @@ -180,6 +199,9 @@ def __init__( self.grpc_prepare_timeout = grpc_options.get('grpc_prepare_timeout') or self.grpc_prepare_timeout self._create_client() + def reset_session(self): + self._session_id = None + def _create_client(self): if self._secure_channel: self._channel = grpc.secure_channel( @@ -260,7 +282,8 @@ def set_prop_map(self, prop_map: str): :param prop_map: To set engine props """ set_props_request = e6x_engine_pb2.SetPropsRequest(sessionId=self.get_session_id, props=prop_map) - self._client.setProps(set_props_request) + _retry(self._client, "setProps", 0, set_props_request) + def __enter__(self): """Transport should already be opened by __init__""" @@ -361,6 +384,12 @@ def cursor(self, catalog_name=None, db_name=None): """Return a new :py:class:`Cursor` object using the connection.""" return Cursor(self, database=db_name, catalog_name=catalog_name) + def load_parquet(self, parquet_path): + return DataFrame(self, file_path=parquet_path) + + def createMLPipeline(self): + return MLPipeline(self) + def rollback(self): raise Exception("e6xdb does not support transactions") # pragma: no cover @@ -368,8 +397,166 @@ def rollback(self): def client(self): return self._client +class DataFrame: + + def __init__(self, connection: Connection, file_path): + self.connection = connection + self._file_path = file_path + self._engine_ip = connection.host + self._sessionId = connection.get_session_id + self._is_metadata_updated = False + self._query_id = None + self._data = None + self._batch = None + self._create_dataframe() + + def __enter__(self): + pass + + def __exit__(self, exc_type, exc_val, exc_tb): + pass + + def _create_dataframe(self): + client = self.connection.client + + create_dataframe_request = e6x_engine_pb2.CreateDataFrameRequest( + parquetFilePath=self._file_path, + catalog=self.connection.catalog_name, + schema=self.connection.database, + sessionId=self._sessionId, + engineIP=self._engine_ip + ) + + create_dataframe_response = client.createDataFrame( + create_dataframe_request + ) + self._query_id = create_dataframe_response.queryId + + def select(self, *fields) -> "DataFrame": + projection_fields = [] + for field in fields: + projection_fields.append(field) + + client = self.connection.client + projection_on_dataframe_request = e6x_engine_pb2.ProjectionOnDataFrameRequest( + queryId=self._query_id, + sessionId=self._sessionId, + field=projection_fields + ) + + projection_on_dataframe_response = client.projectionOnDataFrame( + projection_on_dataframe_request + ) + + return self + + def where(self, where_clause : str) -> "DataFrame": + client = self.connection.client + filter_on_dataframe_request = e6x_engine_pb2.FilterOnDataFrameRequest( + queryId=self._query_id, + sessionId=self._sessionId, + whereClause=where_clause + ) + + filter_on_dataframe_response = client.filterOnDataFrame( + filter_on_dataframe_request + ) + + return self + + def order_by(self, *field_list) -> "DataFrame": + orderby_fields = [] + sort_direction_request = [] + null_direction_request = [] + for field in field_list: + orderby_fields.append(field) + + client = self.connection.client + + orderby_on_dataframe_request = e6x_engine_pb2.OrderByOnDataFrameRequest( + queryId=self._query_id, + sessionId=self._sessionId, + field=orderby_fields, + sortDirection=sort_direction_request, + nullsDirection=null_direction_request + ) + + orderby_on_dataframe_response = client.orderByOnDataFrame( + orderby_on_dataframe_request + ) + return self + + def limit(self, fetch_limit : int) -> "DataFrame": + client = self.connection.client + limit_on_dataframe_request = e6x_engine_pb2.LimitOnDataFrameRequest( + queryId=self._query_id, + sessionId=self._sessionId, + fetchLimit=fetch_limit + ) + + limit_on_dataframe_response = client.limitOnDataFrame( + limit_on_dataframe_request + ) + + return self + + def show(self): + self.execute() + return self.fetchall() + + def execute(self): + client = self.connection.client + execute_dataframe_request = e6x_engine_pb2.ExecuteDataFrameRequest( + queryId=self._query_id, + sessionId=self._sessionId + ) + execute_dataframe_response = client.executeDataFrame( + execute_dataframe_request + ) + + def _update_meta_data(self): + result_meta_data_request = e6x_engine_pb2.GetResultMetadataRequest( + engineIP=self._engine_ip, + sessionId=self._sessionId, + queryId=self._query_id + ) + get_result_metadata_response = self.connection.client.getResultMetadata( + result_meta_data_request, + ) + buffer = BytesIO(get_result_metadata_response.resultMetaData) + self._rowcount, self._query_columns_description = get_query_columns_info(buffer) + self._is_metadata_updated = True + + def _fetch_batch(self): + client = self.connection.client + get_next_result_batch_request = e6x_engine_pb2.GetNextResultBatchRequest( + engineIP=self._engine_ip, + sessionId=self._sessionId, + queryId=self._query_id + ) + get_next_result_batch_response = client.getNextResultBatch( + get_next_result_batch_request, + ) + buffer = get_next_result_batch_response.resultBatch + if not self._is_metadata_updated: + self._update_meta_data() + if not buffer or len(buffer) == 0: + return None + # one batch retrieves the predefined set of rows + return read_rows_from_chunk(self._query_columns_description, buffer) + + def fetchall(self): + self._data = list() + while True: + rows = self._fetch_batch() + if rows is None: + break + self._data = self._data + rows + rows = self._data + self._data = None + return rows -class Cursor(DBAPICursor): +class Cursor(DBAPICursor, RetryableConnection): """These objects represent a database cursor, which is used to manage the context of a fetch operation. Cursors are not isolated, i.e., any changes done to the database by a cursor are immediately @@ -391,6 +578,9 @@ def __init__(self, connection: Connection, array_size=1000, database=None, catal self._database = self.connection.database if database is None else database self._catalog_name = catalog_name if catalog_name else self.connection.catalog_name + def reset_session(self): + self.connection.reset_session() + def _reset_state(self): """Reset state about the previous query in preparation for running another query""" pass @@ -689,6 +879,130 @@ def explain_analyse(self): planner=explain_analyze_response.explainAnalyze, ) +class Matrix: + def __init__(self, connection: Connection): + self.connection = connection + + def __enter__(self): + pass + def __exit__(self, exc_type, exc_val, exc_tb): + pass + + def flatten_2d_array(self, matrix): + return [value for row in matrix for value in row] + + def reshape_1d_to_2d(self, flattened, rows, cols): + return [flattened[i * cols:(i + 1) * cols] for i in range(rows)] + + def matmul(self, matrixA, matrixB): + request = e6x_engine_pb2.MatrixRequest( + operation="multiply", + matrix1=self.flatten_2d_array(matrixA), + rows1=len(matrixA), + cols1=len(matrixA[0]), + matrix2=self.flatten_2d_array(matrixB), + rows2=len(matrixB), + cols2=len(matrixB[0]) + ) + + response = self.connection.client.ComputeMatrix(request) + + # Convert the response back to a NumPy array + result_matrix = self.reshape_1d_to_2d(response.result, response.rows, response.cols) + print("Resultant Matrix:") + print(result_matrix) + + def add(self, matrixA, matrixB): + request = e6x_engine_pb2.MatrixRequest( + operation="add", + matrix1=self.flatten_2d_array(matrixA), + rows1=len(matrixA), + cols1=len(matrixA[0]), + matrix2=self.flatten_2d_array(matrixB), + rows2=len(matrixB), + cols2=len(matrixB[0]) + ) + + response = self.connection.client.ComputeMatrix(request) + + # Convert the response back to a NumPy array + result_matrix = self.reshape_1d_to_2d(response.result, response.rows, response.cols) + #print("Resultant Matrix:") + print(result_matrix) + def transpose(self, matrixA): + request = e6x_engine_pb2.MatrixRequest( + operation="transpose", + matrix1=self.flatten_2d_array(matrixA), + rows1=len(matrixA), + cols1=len(matrixA[0])) + + response = self.connection.client.ComputeMatrix(request) + + # Convert the response back to a NumPy array + result_matrix = self.reshape_1d_to_2d(response.result, response.rows, response.cols) + print("Resultant Matrix:") + print(result_matrix) + + def inverse(self, matrixA): + request = e6x_engine_pb2.MatrixRequest( + operation="inverse", + matrix1=self.flatten_2d_array(matrixA), + rows1=len(matrixA), + cols1=len(matrixA[0])) + + response = self.connection.client.ComputeMatrix(request) + + # Convert the response back to a NumPy array + result_matrix = self.reshape_1d_to_2d(response.result, response.rows, response.cols) + print("Resultant Matrix:") + print(result_matrix) + + +class MLPipeline: + def __init__(self, connection: Connection): + self.connection = connection + self._engine_ip = connection.host + self._sessionId = connection.get_session_id + self._database = self.connection.database + self._catalog_name = self.connection.catalog_name + + def __enter__(self): + pass + def __exit__(self, exc_type, exc_val, exc_tb): + pass + + def train_linear_model(self, sql_query): + self.tasks.append({ + "type": "train", + "sql_query": sql_query + }) + return self + + def predict_linear_model(self, sql_query): + self.tasks.append({ + "type": "predict", + "sql_query": sql_query + }) + return self + + def execute(self): + client = self.connection.client + execute_mlpipeline_request = e6x_engine_pb2.executeMLPipeline( + queryId=self._query_id, + sessionId=self._sessionId + ) + execute_mlpipeline_response = client.executeMLPipeline(execute_mlpipeline_request) + + # Step 4: Extract the DoubleMatrix from the response + double_matrix = execute_mlpipeline_response.result # Assuming `result` is the DoubleMatrix field + + # Step 5: Convert DoubleMatrix to a Python 2D list + matrix = [[value for value in row.values] for row in double_matrix.rows] + + # Step 6: Process or print the matrix + print("Received matrix:") + for row in matrix: + print(row) def poll(self, get_progress_update=True): """Poll for and return the raw status data provided by the Hive Thrift REST API. diff --git a/e6data_python_connector/server/e6x_engine_pb2.py b/e6data_python_connector/server/e6x_engine_pb2.py index 756dbd5..4d5bbb4 100644 --- a/e6data_python_connector/server/e6x_engine_pb2.py +++ b/e6data_python_connector/server/e6x_engine_pb2.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: e6x_engine.proto +# Protobuf Python Version: 5.28.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 28, + 1, + '', + 'e6x_engine.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,14 +24,18 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x65\x36x_engine.proto\"2\n\nGFieldInfo\x12\x11\n\tfieldName\x18\x01 \x01(\t\x12\x11\n\tfieldType\x18\x02 \x01(\t\"A\n\x13\x46\x61iledSchemaElement\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0e\n\x06reason\x18\x03 \x01(\t\"P\n\x16GetAddCatalogsResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\x12&\n\x08\x66\x61ilures\x18\x02 \x03(\x0b\x32\x14.FailedSchemaElement\"2\n\x0f\x43\x61talogResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tisDefault\x18\x02 \x01(\x08\"<\n\x0eParameterValue\x12\r\n\x05index\x18\x01 \x01(\x11\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\"D\n\x0c\x43learRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"\x0f\n\rClearResponse\"J\n\x12\x43\x61ncelQueryRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"\x15\n\x13\x43\x61ncelQueryResponse\"F\n\x0e\x45xplainRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"\"\n\x0f\x45xplainResponse\x12\x0f\n\x07\x65xplain\x18\x01 \x01(\t\"Y\n\rDryRunRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0e\n\x06schema\x18\x03 \x01(\t\x12\x13\n\x0bqueryString\x18\x04 \x01(\t\"%\n\x0e\x44ryRunResponse\x12\x13\n\x0b\x64ryrunValue\x18\x01 \x01(\t\"l\n\x0f\x44ryRunRequestV2\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0e\n\x06schema\x18\x03 \x01(\t\x12\x13\n\x0bqueryString\x18\x04 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x05 \x01(\t\"M\n\x15\x45xplainAnalyzeRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"m\n\x16\x45xplainAnalyzeResponse\x12\x16\n\x0e\x65xplainAnalyze\x18\x01 \x01(\t\x12\x10\n\x08isCached\x18\x02 \x01(\x08\x12\x13\n\x0bparsingTime\x18\x03 \x01(\x12\x12\x14\n\x0cqueueingTime\x18\x04 \x01(\x12\"b\n\x17PrepareStatementRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\x13\n\x0bqueryString\x18\x03 \x01(\t\x12\x0f\n\x07quoting\x18\x04 \x01(\t\"u\n\x19PrepareStatementV2Request\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x03 \x01(\t\x12\x13\n\x0bqueryString\x18\x04 \x01(\t\x12\x0f\n\x07quoting\x18\x05 \x01(\t\"=\n\x18PrepareStatementResponse\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x0f\n\x07queryId\x18\x02 \x01(\t\"@\n\x0eUserAccessInfo\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x10\n\x08userName\x18\x02 \x01(\t\x12\x0e\n\x06tokens\x18\x03 \x03(\t\"g\n\x17\x45xecuteStatementRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\x12\x16\n\x0eshouldNotCache\x18\x04 \x01(\x08\"\x8a\x01\n\x19\x45xecuteStatementV2Request\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\x12\x16\n\x0eshouldNotCache\x18\x04 \x01(\x08\x12\x1f\n\x06params\x18\x05 \x03(\x0b\x32\x0f.ParameterValue\"\x1a\n\x18\x45xecuteStatementResponse\"O\n\x17GetNextResultRowRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"-\n\x18GetNextResultRowResponse\x12\x11\n\tresultRow\x18\x02 \x01(\x0c\"w\n\x19GetNextResultBatchRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\x12\x16\n\tasRowData\x18\x04 \x01(\x08H\x00\x88\x01\x01\x42\x0c\n\n_asRowData\"1\n\x1aGetNextResultBatchResponse\x12\x13\n\x0bresultBatch\x18\x02 \x01(\x0c\"P\n\x18GetResultMetadataRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"3\n\x19GetResultMetadataResponse\x12\x16\n\x0eresultMetaData\x18\x01 \x01(\x0c\"5\n\x13\x41uthenticateRequest\x12\x0c\n\x04user\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\")\n\x14\x41uthenticateResponse\x12\x11\n\tsessionId\x18\x01 \x01(\t\"5\n\x10GetTablesRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\"H\n\x12GetTablesV2Request\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x03 \x01(\t\"#\n\x11GetTablesResponse\x12\x0e\n\x06tables\x18\x01 \x03(\t\"*\n\x15GetSchemaNamesRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\"=\n\x17GetSchemaNamesV2Request\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x02 \x01(\t\")\n\x16GetSchemaNamesResponse\x12\x0f\n\x07schemas\x18\x01 \x03(\t\"E\n\x11GetColumnsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\r\n\x05table\x18\x03 \x01(\t\"X\n\x13GetColumnsV2Request\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\r\n\x05table\x18\x03 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x04 \x01(\t\"4\n\x12GetColumnsResponse\x12\x1e\n\tfieldInfo\x18\x01 \x03(\x0b\x32\x0b.GFieldInfo\"E\n\rStatusRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"2\n\x0eStatusResponse\x12\x0e\n\x06status\x18\x02 \x01(\x08\x12\x10\n\x08rowCount\x18\x03 \x01(\x12\"5\n\x12\x41\x64\x64\x43\x61talogsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0c\n\x04json\x18\x02 \x01(\t\"#\n\x12UpdateUsersRequest\x12\r\n\x05users\x18\x01 \x01(\x0c\"\x15\n\x13UpdateUsersResponse\"3\n\x0fSetPropsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\r\n\x05props\x18\x02 \x01(\t\"\x12\n\x10SetPropsResponse\"*\n\x15GetAddCatalogsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\"\x15\n\x13\x41\x64\x64\x43\x61talogsResponse\"\x15\n\x13GetCatalogesRequest\"B\n\x14GetCatalogesResponse\x12*\n\x10\x63\x61talogResponses\x18\x01 \x03(\x0b\x32\x10.CatalogResponse\"+\n\x16RefreshCatalogsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\"\x19\n\x17RefreshCatalogsResponse\"X\n\x12RemoteChunkRequest\x12\x17\n\x0foriginalQueryId\x18\x01 \x01(\t\x12\x15\n\rremoteQueryId\x18\x02 \x01(\t\x12\x12\n\nsQueryHash\x18\x03 \x01(\t\"3\n\x13RemoteChunkResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\r\n\x05\x63hunk\x18\x02 \x01(\x0c\"Q\n\x19\x43learOrCancelQueryRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"\x1c\n\x1a\x43learOrCancelQueryResponse2\xaa\x0e\n\x12QueryEngineService\x12&\n\x05\x63lear\x12\r.ClearRequest\x1a\x0e.ClearResponse\x12\x38\n\x0b\x63\x61ncelQuery\x12\x13.CancelQueryRequest\x1a\x14.CancelQueryResponse\x12M\n\x12\x63learOrCancelQuery\x12\x1a.ClearOrCancelQueryRequest\x1a\x1b.ClearOrCancelQueryResponse\x12,\n\x07\x65xplain\x12\x0f.ExplainRequest\x1a\x10.ExplainResponse\x12)\n\x06\x64ryRun\x12\x0e.DryRunRequest\x1a\x0f.DryRunResponse\x12-\n\x08\x64ryRunV2\x12\x10.DryRunRequestV2\x1a\x0f.DryRunResponse\x12\x41\n\x0e\x65xplainAnalyze\x12\x16.ExplainAnalyzeRequest\x1a\x17.ExplainAnalyzeResponse\x12G\n\x10prepareStatement\x12\x18.PrepareStatementRequest\x1a\x19.PrepareStatementResponse\x12K\n\x12prepareStatementV2\x12\x1a.PrepareStatementV2Request\x1a\x19.PrepareStatementResponse\x12G\n\x10\x65xecuteStatement\x12\x18.ExecuteStatementRequest\x1a\x19.ExecuteStatementResponse\x12K\n\x12\x65xecuteStatementV2\x12\x1a.ExecuteStatementV2Request\x1a\x19.ExecuteStatementResponse\x12G\n\x10getNextResultRow\x12\x18.GetNextResultRowRequest\x1a\x19.GetNextResultRowResponse\x12M\n\x12getNextResultBatch\x12\x1a.GetNextResultBatchRequest\x1a\x1b.GetNextResultBatchResponse\x12J\n\x11getResultMetadata\x12\x19.GetResultMetadataRequest\x1a\x1a.GetResultMetadataResponse\x12;\n\x0c\x61uthenticate\x12\x14.AuthenticateRequest\x1a\x15.AuthenticateResponse\x12\x32\n\tgetTables\x12\x11.GetTablesRequest\x1a\x12.GetTablesResponse\x12\x36\n\x0bgetTablesV2\x12\x13.GetTablesV2Request\x1a\x12.GetTablesResponse\x12\x41\n\x0egetSchemaNames\x12\x16.GetSchemaNamesRequest\x1a\x17.GetSchemaNamesResponse\x12\x45\n\x10getSchemaNamesV2\x12\x18.GetSchemaNamesV2Request\x1a\x17.GetSchemaNamesResponse\x12\x35\n\ngetColumns\x12\x12.GetColumnsRequest\x1a\x13.GetColumnsResponse\x12\x39\n\x0cgetColumnsV2\x12\x14.GetColumnsV2Request\x1a\x13.GetColumnsResponse\x12\x38\n\x0bupdateUsers\x12\x13.UpdateUsersRequest\x1a\x14.UpdateUsersResponse\x12/\n\x08setProps\x12\x10.SetPropsRequest\x1a\x11.SetPropsResponse\x12)\n\x06status\x12\x0e.StatusRequest\x1a\x0f.StatusResponse\x12\x38\n\x0b\x61\x64\x64\x43\x61talogs\x12\x13.AddCatalogsRequest\x1a\x14.AddCatalogsResponse\x12I\n\x16getAddCatalogsResponse\x12\x16.GetAddCatalogsRequest\x1a\x17.GetAddCatalogsResponse\x12;\n\x0cgetCataloges\x12\x14.GetCatalogesRequest\x1a\x15.GetCatalogesResponse\x12\x45\n\x18getNextRemoteCachedChunk\x12\x13.RemoteChunkRequest\x1a\x14.RemoteChunkResponse\x12\x44\n\x0frefreshCatalogs\x12\x17.RefreshCatalogsRequest\x1a\x18.RefreshCatalogsResponseB\x02P\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x65\x36x_engine.proto\"2\n\nGFieldInfo\x12\x11\n\tfieldName\x18\x01 \x01(\t\x12\x11\n\tfieldType\x18\x02 \x01(\t\"A\n\x13\x46\x61iledSchemaElement\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0e\n\x06reason\x18\x03 \x01(\t\"P\n\x16GetAddCatalogsResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\x12&\n\x08\x66\x61ilures\x18\x02 \x03(\x0b\x32\x14.FailedSchemaElement\"2\n\x0f\x43\x61talogResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tisDefault\x18\x02 \x01(\x08\"<\n\x0eParameterValue\x12\r\n\x05index\x18\x01 \x01(\x11\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\"D\n\x0c\x43learRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"\x0f\n\rClearResponse\"J\n\x12\x43\x61ncelQueryRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"\x15\n\x13\x43\x61ncelQueryResponse\"F\n\x0e\x45xplainRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"\"\n\x0f\x45xplainResponse\x12\x0f\n\x07\x65xplain\x18\x01 \x01(\t\"Y\n\rDryRunRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0e\n\x06schema\x18\x03 \x01(\t\x12\x13\n\x0bqueryString\x18\x04 \x01(\t\"%\n\x0e\x44ryRunResponse\x12\x13\n\x0b\x64ryrunValue\x18\x01 \x01(\t\"l\n\x0f\x44ryRunRequestV2\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0e\n\x06schema\x18\x03 \x01(\t\x12\x13\n\x0bqueryString\x18\x04 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x05 \x01(\t\"M\n\x15\x45xplainAnalyzeRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"m\n\x16\x45xplainAnalyzeResponse\x12\x16\n\x0e\x65xplainAnalyze\x18\x01 \x01(\t\x12\x10\n\x08isCached\x18\x02 \x01(\x08\x12\x13\n\x0bparsingTime\x18\x03 \x01(\x12\x12\x14\n\x0cqueueingTime\x18\x04 \x01(\x12\"b\n\x17PrepareStatementRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\x13\n\x0bqueryString\x18\x03 \x01(\t\x12\x0f\n\x07quoting\x18\x04 \x01(\t\"u\n\x19PrepareStatementV2Request\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x03 \x01(\t\x12\x13\n\x0bqueryString\x18\x04 \x01(\t\x12\x0f\n\x07quoting\x18\x05 \x01(\t\"=\n\x18PrepareStatementResponse\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x0f\n\x07queryId\x18\x02 \x01(\t\"@\n\x0eUserAccessInfo\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x10\n\x08userName\x18\x02 \x01(\t\x12\x0e\n\x06tokens\x18\x03 \x03(\t\"g\n\x17\x45xecuteStatementRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\x12\x16\n\x0eshouldNotCache\x18\x04 \x01(\x08\"\x8a\x01\n\x19\x45xecuteStatementV2Request\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\x12\x16\n\x0eshouldNotCache\x18\x04 \x01(\x08\x12\x1f\n\x06params\x18\x05 \x03(\x0b\x32\x0f.ParameterValue\"\x1a\n\x18\x45xecuteStatementResponse\"O\n\x17GetNextResultRowRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"-\n\x18GetNextResultRowResponse\x12\x11\n\tresultRow\x18\x02 \x01(\x0c\"w\n\x19GetNextResultBatchRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\x12\x16\n\tasRowData\x18\x04 \x01(\x08H\x00\x88\x01\x01\x42\x0c\n\n_asRowData\"1\n\x1aGetNextResultBatchResponse\x12\x13\n\x0bresultBatch\x18\x02 \x01(\x0c\"P\n\x18GetResultMetadataRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"3\n\x19GetResultMetadataResponse\x12\x16\n\x0eresultMetaData\x18\x01 \x01(\x0c\"5\n\x13\x41uthenticateRequest\x12\x0c\n\x04user\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\")\n\x14\x41uthenticateResponse\x12\x11\n\tsessionId\x18\x01 \x01(\t\"5\n\x10GetTablesRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\"H\n\x12GetTablesV2Request\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x03 \x01(\t\"#\n\x11GetTablesResponse\x12\x0e\n\x06tables\x18\x01 \x03(\t\"*\n\x15GetSchemaNamesRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\"=\n\x17GetSchemaNamesV2Request\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x02 \x01(\t\")\n\x16GetSchemaNamesResponse\x12\x0f\n\x07schemas\x18\x01 \x03(\t\"E\n\x11GetColumnsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\r\n\x05table\x18\x03 \x01(\t\"X\n\x13GetColumnsV2Request\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\x12\r\n\x05table\x18\x03 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x04 \x01(\t\"4\n\x12GetColumnsResponse\x12\x1e\n\tfieldInfo\x18\x01 \x03(\x0b\x32\x0b.GFieldInfo\"E\n\rStatusRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"2\n\x0eStatusResponse\x12\x0e\n\x06status\x18\x02 \x01(\x08\x12\x10\n\x08rowCount\x18\x03 \x01(\x12\"5\n\x12\x41\x64\x64\x43\x61talogsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\x0c\n\x04json\x18\x02 \x01(\t\"#\n\x12UpdateUsersRequest\x12\r\n\x05users\x18\x01 \x01(\x0c\"\x15\n\x13UpdateUsersResponse\"3\n\x0fSetPropsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\r\n\x05props\x18\x02 \x01(\t\"\x12\n\x10SetPropsResponse\"*\n\x15GetAddCatalogsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\"\x15\n\x13\x41\x64\x64\x43\x61talogsResponse\"\x15\n\x13GetCatalogesRequest\"B\n\x14GetCatalogesResponse\x12*\n\x10\x63\x61talogResponses\x18\x01 \x03(\x0b\x32\x10.CatalogResponse\"+\n\x16RefreshCatalogsRequest\x12\x11\n\tsessionId\x18\x01 \x01(\t\"\x19\n\x17RefreshCatalogsResponse\"X\n\x12RemoteChunkRequest\x12\x17\n\x0foriginalQueryId\x18\x01 \x01(\t\x12\x15\n\rremoteQueryId\x18\x02 \x01(\t\x12\x12\n\nsQueryHash\x18\x03 \x01(\t\"3\n\x13RemoteChunkResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\r\n\x05\x63hunk\x18\x02 \x01(\x0c\"Q\n\x19\x43learOrCancelQueryRequest\x12\x10\n\x08\x65ngineIP\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x0f\n\x07queryId\x18\x03 \x01(\t\"\x1c\n\x1a\x43learOrCancelQueryResponse\"w\n\x16\x43reateDataFrameRequest\x12\x17\n\x0fparquetFilePath\x18\x01 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x02 \x01(\t\x12\x0e\n\x06schema\x18\x03 \x01(\t\x12\x11\n\tsessionId\x18\x04 \x01(\t\x12\x10\n\x08\x65ngineIP\x18\x05 \x01(\t\"*\n\x17\x43reateDataFrameResponse\x12\x0f\n\x07queryId\x18\x01 \x01(\t\"Q\n\x1cProjectionOnDataFrameRequest\x12\x0f\n\x07queryId\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\r\n\x05\x66ield\x18\x03 \x03(\t\"\x1f\n\x1dProjectionOnDataFrameResponse\"S\n\x18\x46ilterOnDataFrameRequest\x12\x0f\n\x07queryId\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x13\n\x0bwhereClause\x18\x03 \x01(\t\"\x1b\n\x19\x46ilterOnDataFrameResponse\"\x9d\x01\n\x19OrderByOnDataFrameRequest\x12\x0f\n\x07queryId\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\r\n\x05\x66ield\x18\x03 \x03(\t\x12%\n\rsortDirection\x18\x04 \x03(\x0e\x32\x0e.SortDirection\x12&\n\x0enullsDirection\x18\x05 \x03(\x0e\x32\x0e.NullDirection\"\x1c\n\x1aOrderByOnDataFrameResponse\"Q\n\x17LimitOnDataFrameRequest\x12\x0f\n\x07queryId\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\x12\x12\n\nfetchLimit\x18\x03 \x01(\x05\"\x1a\n\x18LimitOnDataFrameResponse\"=\n\x17\x45xecuteDataFrameRequest\x12\x0f\n\x07queryId\x18\x01 \x01(\t\x12\x11\n\tsessionId\x18\x02 \x01(\t\"\x1a\n\x18\x45xecuteDataFrameResponse\"\x1b\n\tDoubleRow\x12\x0e\n\x06values\x18\x01 \x03(\x01\"(\n\x0c\x44oubleMatrix\x12\x18\n\x04rows\x18\x01 \x03(\x0b\x32\n.DoubleRow\"9\n\x04Task\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x11\n\tsql_query\x18\x02 \x01(\t\x12\x10\n\x08model_id\x18\x03 \x01(\t\"\x1b\n\x03\x44\x41G\x12\x14\n\x05tasks\x18\x01 \x03(\x0b\x32\x05.Task\"b\n\x18\x45xecuteMLPipelineRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0f\n\x07\x63\x61talog\x18\x02 \x01(\t\x12\x0e\n\x06schema\x18\x03 \x01(\t\x12\x11\n\x03\x64\x61g\x18\x04 \x01(\x0b\x32\x04.DAG\"J\n\x19\x45xecuteMLPipelineResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x1d\n\x06result\x18\x02 \x01(\x0b\x32\r.DoubleMatrix\"\x9e\x01\n\rMatrixRequest\x12\x11\n\toperation\x18\x01 \x01(\t\x12\x0f\n\x07matrix1\x18\x02 \x03(\x01\x12\r\n\x05rows1\x18\x03 \x01(\x05\x12\r\n\x05\x63ols1\x18\x04 \x01(\x05\x12\x0f\n\x07matrix2\x18\x05 \x03(\x01\x12\x12\n\x05rows2\x18\x06 \x01(\x05H\x00\x88\x01\x01\x12\x12\n\x05\x63ols2\x18\x07 \x01(\x05H\x01\x88\x01\x01\x42\x08\n\x06_rows2B\x08\n\x06_cols2\"L\n\x0eMatrixResponse\x12\x0e\n\x06result\x18\x01 \x03(\x01\x12\x0c\n\x04rows\x18\x02 \x01(\x05\x12\x0c\n\x04\x63ols\x18\x03 \x01(\x05\x12\x0e\n\x06status\x18\x04 \x01(\t*\"\n\rSortDirection\x12\x07\n\x03\x41SC\x10\x00\x12\x08\n\x04\x44\x45SC\x10\x01*$\n\rNullDirection\x12\t\n\x05\x46IRST\x10\x00\x12\x08\n\x04LAST\x10\x01\x32\xf3\x12\n\x12QueryEngineService\x12&\n\x05\x63lear\x12\r.ClearRequest\x1a\x0e.ClearResponse\x12\x38\n\x0b\x63\x61ncelQuery\x12\x13.CancelQueryRequest\x1a\x14.CancelQueryResponse\x12M\n\x12\x63learOrCancelQuery\x12\x1a.ClearOrCancelQueryRequest\x1a\x1b.ClearOrCancelQueryResponse\x12,\n\x07\x65xplain\x12\x0f.ExplainRequest\x1a\x10.ExplainResponse\x12)\n\x06\x64ryRun\x12\x0e.DryRunRequest\x1a\x0f.DryRunResponse\x12-\n\x08\x64ryRunV2\x12\x10.DryRunRequestV2\x1a\x0f.DryRunResponse\x12\x41\n\x0e\x65xplainAnalyze\x12\x16.ExplainAnalyzeRequest\x1a\x17.ExplainAnalyzeResponse\x12G\n\x10prepareStatement\x12\x18.PrepareStatementRequest\x1a\x19.PrepareStatementResponse\x12K\n\x12prepareStatementV2\x12\x1a.PrepareStatementV2Request\x1a\x19.PrepareStatementResponse\x12G\n\x10\x65xecuteStatement\x12\x18.ExecuteStatementRequest\x1a\x19.ExecuteStatementResponse\x12K\n\x12\x65xecuteStatementV2\x12\x1a.ExecuteStatementV2Request\x1a\x19.ExecuteStatementResponse\x12G\n\x10getNextResultRow\x12\x18.GetNextResultRowRequest\x1a\x19.GetNextResultRowResponse\x12M\n\x12getNextResultBatch\x12\x1a.GetNextResultBatchRequest\x1a\x1b.GetNextResultBatchResponse\x12J\n\x11getResultMetadata\x12\x19.GetResultMetadataRequest\x1a\x1a.GetResultMetadataResponse\x12;\n\x0c\x61uthenticate\x12\x14.AuthenticateRequest\x1a\x15.AuthenticateResponse\x12\x32\n\tgetTables\x12\x11.GetTablesRequest\x1a\x12.GetTablesResponse\x12\x36\n\x0bgetTablesV2\x12\x13.GetTablesV2Request\x1a\x12.GetTablesResponse\x12\x41\n\x0egetSchemaNames\x12\x16.GetSchemaNamesRequest\x1a\x17.GetSchemaNamesResponse\x12\x45\n\x10getSchemaNamesV2\x12\x18.GetSchemaNamesV2Request\x1a\x17.GetSchemaNamesResponse\x12\x35\n\ngetColumns\x12\x12.GetColumnsRequest\x1a\x13.GetColumnsResponse\x12\x39\n\x0cgetColumnsV2\x12\x14.GetColumnsV2Request\x1a\x13.GetColumnsResponse\x12\x38\n\x0bupdateUsers\x12\x13.UpdateUsersRequest\x1a\x14.UpdateUsersResponse\x12/\n\x08setProps\x12\x10.SetPropsRequest\x1a\x11.SetPropsResponse\x12)\n\x06status\x12\x0e.StatusRequest\x1a\x0f.StatusResponse\x12\x38\n\x0b\x61\x64\x64\x43\x61talogs\x12\x13.AddCatalogsRequest\x1a\x14.AddCatalogsResponse\x12I\n\x16getAddCatalogsResponse\x12\x16.GetAddCatalogsRequest\x1a\x17.GetAddCatalogsResponse\x12;\n\x0cgetCataloges\x12\x14.GetCatalogesRequest\x1a\x15.GetCatalogesResponse\x12\x45\n\x18getNextRemoteCachedChunk\x12\x13.RemoteChunkRequest\x1a\x14.RemoteChunkResponse\x12\x44\n\x0frefreshCatalogs\x12\x17.RefreshCatalogsRequest\x1a\x18.RefreshCatalogsResponse\x12\x44\n\x0f\x63reateDataFrame\x12\x17.CreateDataFrameRequest\x1a\x18.CreateDataFrameResponse\x12V\n\x15projectionOnDataFrame\x12\x1d.ProjectionOnDataFrameRequest\x1a\x1e.ProjectionOnDataFrameResponse\x12J\n\x11\x66ilterOnDataFrame\x12\x19.FilterOnDataFrameRequest\x1a\x1a.FilterOnDataFrameResponse\x12M\n\x12orderByOnDataFrame\x12\x1a.OrderByOnDataFrameRequest\x1a\x1b.OrderByOnDataFrameResponse\x12G\n\x10limitOnDataFrame\x12\x18.LimitOnDataFrameRequest\x1a\x19.LimitOnDataFrameResponse\x12G\n\x10\x65xecuteDataFrame\x12\x18.ExecuteDataFrameRequest\x1a\x19.ExecuteDataFrameResponse\x12J\n\x11\x65xecuteMLPipeline\x12\x19.ExecuteMLPipelineRequest\x1a\x1a.ExecuteMLPipelineResponse\x12\x30\n\rComputeMatrix\x12\x0e.MatrixRequest\x1a\x0f.MatrixResponseB\x02P\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'e6x_engine_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'P\001' +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'P\001' + _globals['_SORTDIRECTION']._serialized_start=4903 + _globals['_SORTDIRECTION']._serialized_end=4937 + _globals['_NULLDIRECTION']._serialized_start=4939 + _globals['_NULLDIRECTION']._serialized_end=4975 _globals['_GFIELDINFO']._serialized_start=20 _globals['_GFIELDINFO']._serialized_end=70 _globals['_FAILEDSCHEMAELEMENT']._serialized_start=72 @@ -135,6 +150,46 @@ _globals['_CLEARORCANCELQUERYREQUEST']._serialized_end=3510 _globals['_CLEARORCANCELQUERYRESPONSE']._serialized_start=3512 _globals['_CLEARORCANCELQUERYRESPONSE']._serialized_end=3540 - _globals['_QUERYENGINESERVICE']._serialized_start=3543 - _globals['_QUERYENGINESERVICE']._serialized_end=5377 + _globals['_CREATEDATAFRAMEREQUEST']._serialized_start=3542 + _globals['_CREATEDATAFRAMEREQUEST']._serialized_end=3661 + _globals['_CREATEDATAFRAMERESPONSE']._serialized_start=3663 + _globals['_CREATEDATAFRAMERESPONSE']._serialized_end=3705 + _globals['_PROJECTIONONDATAFRAMEREQUEST']._serialized_start=3707 + _globals['_PROJECTIONONDATAFRAMEREQUEST']._serialized_end=3788 + _globals['_PROJECTIONONDATAFRAMERESPONSE']._serialized_start=3790 + _globals['_PROJECTIONONDATAFRAMERESPONSE']._serialized_end=3821 + _globals['_FILTERONDATAFRAMEREQUEST']._serialized_start=3823 + _globals['_FILTERONDATAFRAMEREQUEST']._serialized_end=3906 + _globals['_FILTERONDATAFRAMERESPONSE']._serialized_start=3908 + _globals['_FILTERONDATAFRAMERESPONSE']._serialized_end=3935 + _globals['_ORDERBYONDATAFRAMEREQUEST']._serialized_start=3938 + _globals['_ORDERBYONDATAFRAMEREQUEST']._serialized_end=4095 + _globals['_ORDERBYONDATAFRAMERESPONSE']._serialized_start=4097 + _globals['_ORDERBYONDATAFRAMERESPONSE']._serialized_end=4125 + _globals['_LIMITONDATAFRAMEREQUEST']._serialized_start=4127 + _globals['_LIMITONDATAFRAMEREQUEST']._serialized_end=4208 + _globals['_LIMITONDATAFRAMERESPONSE']._serialized_start=4210 + _globals['_LIMITONDATAFRAMERESPONSE']._serialized_end=4236 + _globals['_EXECUTEDATAFRAMEREQUEST']._serialized_start=4238 + _globals['_EXECUTEDATAFRAMEREQUEST']._serialized_end=4299 + _globals['_EXECUTEDATAFRAMERESPONSE']._serialized_start=4301 + _globals['_EXECUTEDATAFRAMERESPONSE']._serialized_end=4327 + _globals['_DOUBLEROW']._serialized_start=4329 + _globals['_DOUBLEROW']._serialized_end=4356 + _globals['_DOUBLEMATRIX']._serialized_start=4358 + _globals['_DOUBLEMATRIX']._serialized_end=4398 + _globals['_TASK']._serialized_start=4400 + _globals['_TASK']._serialized_end=4457 + _globals['_DAG']._serialized_start=4459 + _globals['_DAG']._serialized_end=4486 + _globals['_EXECUTEMLPIPELINEREQUEST']._serialized_start=4488 + _globals['_EXECUTEMLPIPELINEREQUEST']._serialized_end=4586 + _globals['_EXECUTEMLPIPELINERESPONSE']._serialized_start=4588 + _globals['_EXECUTEMLPIPELINERESPONSE']._serialized_end=4662 + _globals['_MATRIXREQUEST']._serialized_start=4665 + _globals['_MATRIXREQUEST']._serialized_end=4823 + _globals['_MATRIXRESPONSE']._serialized_start=4825 + _globals['_MATRIXRESPONSE']._serialized_end=4901 + _globals['_QUERYENGINESERVICE']._serialized_start=4978 + _globals['_QUERYENGINESERVICE']._serialized_end=7397 # @@protoc_insertion_point(module_scope) diff --git a/e6data_python_connector/server/e6x_engine_pb2.pyi b/e6data_python_connector/server/e6x_engine_pb2.pyi index 90c6bc0..d1e8ec1 100644 --- a/e6data_python_connector/server/e6x_engine_pb2.pyi +++ b/e6data_python_connector/server/e6x_engine_pb2.pyi @@ -1,12 +1,27 @@ from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor +class SortDirection(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + ASC: _ClassVar[SortDirection] + DESC: _ClassVar[SortDirection] + +class NullDirection(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + FIRST: _ClassVar[NullDirection] + LAST: _ClassVar[NullDirection] +ASC: SortDirection +DESC: SortDirection +FIRST: NullDirection +LAST: NullDirection + class GFieldInfo(_message.Message): - __slots__ = ["fieldName", "fieldType"] + __slots__ = ("fieldName", "fieldType") FIELDNAME_FIELD_NUMBER: _ClassVar[int] FIELDTYPE_FIELD_NUMBER: _ClassVar[int] fieldName: str @@ -14,7 +29,7 @@ class GFieldInfo(_message.Message): def __init__(self, fieldName: _Optional[str] = ..., fieldType: _Optional[str] = ...) -> None: ... class FailedSchemaElement(_message.Message): - __slots__ = ["name", "type", "reason"] + __slots__ = ("name", "type", "reason") NAME_FIELD_NUMBER: _ClassVar[int] TYPE_FIELD_NUMBER: _ClassVar[int] REASON_FIELD_NUMBER: _ClassVar[int] @@ -24,7 +39,7 @@ class FailedSchemaElement(_message.Message): def __init__(self, name: _Optional[str] = ..., type: _Optional[str] = ..., reason: _Optional[str] = ...) -> None: ... class GetAddCatalogsResponse(_message.Message): - __slots__ = ["status", "failures"] + __slots__ = ("status", "failures") STATUS_FIELD_NUMBER: _ClassVar[int] FAILURES_FIELD_NUMBER: _ClassVar[int] status: str @@ -32,7 +47,7 @@ class GetAddCatalogsResponse(_message.Message): def __init__(self, status: _Optional[str] = ..., failures: _Optional[_Iterable[_Union[FailedSchemaElement, _Mapping]]] = ...) -> None: ... class CatalogResponse(_message.Message): - __slots__ = ["name", "isDefault"] + __slots__ = ("name", "isDefault") NAME_FIELD_NUMBER: _ClassVar[int] ISDEFAULT_FIELD_NUMBER: _ClassVar[int] name: str @@ -40,7 +55,7 @@ class CatalogResponse(_message.Message): def __init__(self, name: _Optional[str] = ..., isDefault: bool = ...) -> None: ... class ParameterValue(_message.Message): - __slots__ = ["index", "type", "value"] + __slots__ = ("index", "type", "value") INDEX_FIELD_NUMBER: _ClassVar[int] TYPE_FIELD_NUMBER: _ClassVar[int] VALUE_FIELD_NUMBER: _ClassVar[int] @@ -50,7 +65,7 @@ class ParameterValue(_message.Message): def __init__(self, index: _Optional[int] = ..., type: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... class ClearRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId"] + __slots__ = ("engineIP", "sessionId", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -60,11 +75,11 @@ class ClearRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class ClearResponse(_message.Message): - __slots__ = [] + __slots__ = () def __init__(self) -> None: ... class CancelQueryRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId"] + __slots__ = ("engineIP", "sessionId", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -74,11 +89,11 @@ class CancelQueryRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class CancelQueryResponse(_message.Message): - __slots__ = [] + __slots__ = () def __init__(self) -> None: ... class ExplainRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId"] + __slots__ = ("engineIP", "sessionId", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -88,13 +103,13 @@ class ExplainRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class ExplainResponse(_message.Message): - __slots__ = ["explain"] + __slots__ = ("explain",) EXPLAIN_FIELD_NUMBER: _ClassVar[int] explain: str def __init__(self, explain: _Optional[str] = ...) -> None: ... class DryRunRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "schema", "queryString"] + __slots__ = ("engineIP", "sessionId", "schema", "queryString") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] SCHEMA_FIELD_NUMBER: _ClassVar[int] @@ -106,13 +121,13 @@ class DryRunRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., schema: _Optional[str] = ..., queryString: _Optional[str] = ...) -> None: ... class DryRunResponse(_message.Message): - __slots__ = ["dryrunValue"] + __slots__ = ("dryrunValue",) DRYRUNVALUE_FIELD_NUMBER: _ClassVar[int] dryrunValue: str def __init__(self, dryrunValue: _Optional[str] = ...) -> None: ... class DryRunRequestV2(_message.Message): - __slots__ = ["engineIP", "sessionId", "schema", "queryString", "catalog"] + __slots__ = ("engineIP", "sessionId", "schema", "queryString", "catalog") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] SCHEMA_FIELD_NUMBER: _ClassVar[int] @@ -126,7 +141,7 @@ class DryRunRequestV2(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., schema: _Optional[str] = ..., queryString: _Optional[str] = ..., catalog: _Optional[str] = ...) -> None: ... class ExplainAnalyzeRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId"] + __slots__ = ("engineIP", "sessionId", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -136,7 +151,7 @@ class ExplainAnalyzeRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class ExplainAnalyzeResponse(_message.Message): - __slots__ = ["explainAnalyze", "isCached", "parsingTime", "queueingTime"] + __slots__ = ("explainAnalyze", "isCached", "parsingTime", "queueingTime") EXPLAINANALYZE_FIELD_NUMBER: _ClassVar[int] ISCACHED_FIELD_NUMBER: _ClassVar[int] PARSINGTIME_FIELD_NUMBER: _ClassVar[int] @@ -148,7 +163,7 @@ class ExplainAnalyzeResponse(_message.Message): def __init__(self, explainAnalyze: _Optional[str] = ..., isCached: bool = ..., parsingTime: _Optional[int] = ..., queueingTime: _Optional[int] = ...) -> None: ... class PrepareStatementRequest(_message.Message): - __slots__ = ["sessionId", "schema", "queryString", "quoting"] + __slots__ = ("sessionId", "schema", "queryString", "quoting") SESSIONID_FIELD_NUMBER: _ClassVar[int] SCHEMA_FIELD_NUMBER: _ClassVar[int] QUERYSTRING_FIELD_NUMBER: _ClassVar[int] @@ -160,7 +175,7 @@ class PrepareStatementRequest(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., schema: _Optional[str] = ..., queryString: _Optional[str] = ..., quoting: _Optional[str] = ...) -> None: ... class PrepareStatementV2Request(_message.Message): - __slots__ = ["sessionId", "schema", "catalog", "queryString", "quoting"] + __slots__ = ("sessionId", "schema", "catalog", "queryString", "quoting") SESSIONID_FIELD_NUMBER: _ClassVar[int] SCHEMA_FIELD_NUMBER: _ClassVar[int] CATALOG_FIELD_NUMBER: _ClassVar[int] @@ -174,7 +189,7 @@ class PrepareStatementV2Request(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., schema: _Optional[str] = ..., catalog: _Optional[str] = ..., queryString: _Optional[str] = ..., quoting: _Optional[str] = ...) -> None: ... class PrepareStatementResponse(_message.Message): - __slots__ = ["engineIP", "queryId"] + __slots__ = ("engineIP", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] engineIP: str @@ -182,7 +197,7 @@ class PrepareStatementResponse(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class UserAccessInfo(_message.Message): - __slots__ = ["uuid", "userName", "tokens"] + __slots__ = ("uuid", "userName", "tokens") UUID_FIELD_NUMBER: _ClassVar[int] USERNAME_FIELD_NUMBER: _ClassVar[int] TOKENS_FIELD_NUMBER: _ClassVar[int] @@ -192,7 +207,7 @@ class UserAccessInfo(_message.Message): def __init__(self, uuid: _Optional[str] = ..., userName: _Optional[str] = ..., tokens: _Optional[_Iterable[str]] = ...) -> None: ... class ExecuteStatementRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId", "shouldNotCache"] + __slots__ = ("engineIP", "sessionId", "queryId", "shouldNotCache") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -204,7 +219,7 @@ class ExecuteStatementRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ..., shouldNotCache: bool = ...) -> None: ... class ExecuteStatementV2Request(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId", "shouldNotCache", "params"] + __slots__ = ("engineIP", "sessionId", "queryId", "shouldNotCache", "params") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -218,11 +233,11 @@ class ExecuteStatementV2Request(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ..., shouldNotCache: bool = ..., params: _Optional[_Iterable[_Union[ParameterValue, _Mapping]]] = ...) -> None: ... class ExecuteStatementResponse(_message.Message): - __slots__ = [] + __slots__ = () def __init__(self) -> None: ... class GetNextResultRowRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId"] + __slots__ = ("engineIP", "sessionId", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -232,13 +247,13 @@ class GetNextResultRowRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class GetNextResultRowResponse(_message.Message): - __slots__ = ["resultRow"] + __slots__ = ("resultRow",) RESULTROW_FIELD_NUMBER: _ClassVar[int] resultRow: bytes def __init__(self, resultRow: _Optional[bytes] = ...) -> None: ... class GetNextResultBatchRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId", "asRowData"] + __slots__ = ("engineIP", "sessionId", "queryId", "asRowData") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -250,13 +265,13 @@ class GetNextResultBatchRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ..., asRowData: bool = ...) -> None: ... class GetNextResultBatchResponse(_message.Message): - __slots__ = ["resultBatch"] + __slots__ = ("resultBatch",) RESULTBATCH_FIELD_NUMBER: _ClassVar[int] resultBatch: bytes def __init__(self, resultBatch: _Optional[bytes] = ...) -> None: ... class GetResultMetadataRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId"] + __slots__ = ("engineIP", "sessionId", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -266,13 +281,13 @@ class GetResultMetadataRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class GetResultMetadataResponse(_message.Message): - __slots__ = ["resultMetaData"] + __slots__ = ("resultMetaData",) RESULTMETADATA_FIELD_NUMBER: _ClassVar[int] resultMetaData: bytes def __init__(self, resultMetaData: _Optional[bytes] = ...) -> None: ... class AuthenticateRequest(_message.Message): - __slots__ = ["user", "password"] + __slots__ = ("user", "password") USER_FIELD_NUMBER: _ClassVar[int] PASSWORD_FIELD_NUMBER: _ClassVar[int] user: str @@ -280,13 +295,13 @@ class AuthenticateRequest(_message.Message): def __init__(self, user: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... class AuthenticateResponse(_message.Message): - __slots__ = ["sessionId"] + __slots__ = ("sessionId",) SESSIONID_FIELD_NUMBER: _ClassVar[int] sessionId: str def __init__(self, sessionId: _Optional[str] = ...) -> None: ... class GetTablesRequest(_message.Message): - __slots__ = ["sessionId", "schema"] + __slots__ = ("sessionId", "schema") SESSIONID_FIELD_NUMBER: _ClassVar[int] SCHEMA_FIELD_NUMBER: _ClassVar[int] sessionId: str @@ -294,7 +309,7 @@ class GetTablesRequest(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., schema: _Optional[str] = ...) -> None: ... class GetTablesV2Request(_message.Message): - __slots__ = ["sessionId", "schema", "catalog"] + __slots__ = ("sessionId", "schema", "catalog") SESSIONID_FIELD_NUMBER: _ClassVar[int] SCHEMA_FIELD_NUMBER: _ClassVar[int] CATALOG_FIELD_NUMBER: _ClassVar[int] @@ -304,19 +319,19 @@ class GetTablesV2Request(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., schema: _Optional[str] = ..., catalog: _Optional[str] = ...) -> None: ... class GetTablesResponse(_message.Message): - __slots__ = ["tables"] + __slots__ = ("tables",) TABLES_FIELD_NUMBER: _ClassVar[int] tables: _containers.RepeatedScalarFieldContainer[str] def __init__(self, tables: _Optional[_Iterable[str]] = ...) -> None: ... class GetSchemaNamesRequest(_message.Message): - __slots__ = ["sessionId"] + __slots__ = ("sessionId",) SESSIONID_FIELD_NUMBER: _ClassVar[int] sessionId: str def __init__(self, sessionId: _Optional[str] = ...) -> None: ... class GetSchemaNamesV2Request(_message.Message): - __slots__ = ["sessionId", "catalog"] + __slots__ = ("sessionId", "catalog") SESSIONID_FIELD_NUMBER: _ClassVar[int] CATALOG_FIELD_NUMBER: _ClassVar[int] sessionId: str @@ -324,13 +339,13 @@ class GetSchemaNamesV2Request(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., catalog: _Optional[str] = ...) -> None: ... class GetSchemaNamesResponse(_message.Message): - __slots__ = ["schemas"] + __slots__ = ("schemas",) SCHEMAS_FIELD_NUMBER: _ClassVar[int] schemas: _containers.RepeatedScalarFieldContainer[str] def __init__(self, schemas: _Optional[_Iterable[str]] = ...) -> None: ... class GetColumnsRequest(_message.Message): - __slots__ = ["sessionId", "schema", "table"] + __slots__ = ("sessionId", "schema", "table") SESSIONID_FIELD_NUMBER: _ClassVar[int] SCHEMA_FIELD_NUMBER: _ClassVar[int] TABLE_FIELD_NUMBER: _ClassVar[int] @@ -340,7 +355,7 @@ class GetColumnsRequest(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., schema: _Optional[str] = ..., table: _Optional[str] = ...) -> None: ... class GetColumnsV2Request(_message.Message): - __slots__ = ["sessionId", "schema", "table", "catalog"] + __slots__ = ("sessionId", "schema", "table", "catalog") SESSIONID_FIELD_NUMBER: _ClassVar[int] SCHEMA_FIELD_NUMBER: _ClassVar[int] TABLE_FIELD_NUMBER: _ClassVar[int] @@ -352,13 +367,13 @@ class GetColumnsV2Request(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., schema: _Optional[str] = ..., table: _Optional[str] = ..., catalog: _Optional[str] = ...) -> None: ... class GetColumnsResponse(_message.Message): - __slots__ = ["fieldInfo"] + __slots__ = ("fieldInfo",) FIELDINFO_FIELD_NUMBER: _ClassVar[int] fieldInfo: _containers.RepeatedCompositeFieldContainer[GFieldInfo] def __init__(self, fieldInfo: _Optional[_Iterable[_Union[GFieldInfo, _Mapping]]] = ...) -> None: ... class StatusRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId"] + __slots__ = ("engineIP", "sessionId", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -368,7 +383,7 @@ class StatusRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class StatusResponse(_message.Message): - __slots__ = ["status", "rowCount"] + __slots__ = ("status", "rowCount") STATUS_FIELD_NUMBER: _ClassVar[int] ROWCOUNT_FIELD_NUMBER: _ClassVar[int] status: bool @@ -376,7 +391,7 @@ class StatusResponse(_message.Message): def __init__(self, status: bool = ..., rowCount: _Optional[int] = ...) -> None: ... class AddCatalogsRequest(_message.Message): - __slots__ = ["sessionId", "json"] + __slots__ = ("sessionId", "json") SESSIONID_FIELD_NUMBER: _ClassVar[int] JSON_FIELD_NUMBER: _ClassVar[int] sessionId: str @@ -384,17 +399,17 @@ class AddCatalogsRequest(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., json: _Optional[str] = ...) -> None: ... class UpdateUsersRequest(_message.Message): - __slots__ = ["users"] + __slots__ = ("users",) USERS_FIELD_NUMBER: _ClassVar[int] users: bytes def __init__(self, users: _Optional[bytes] = ...) -> None: ... class UpdateUsersResponse(_message.Message): - __slots__ = [] + __slots__ = () def __init__(self) -> None: ... class SetPropsRequest(_message.Message): - __slots__ = ["sessionId", "props"] + __slots__ = ("sessionId", "props") SESSIONID_FIELD_NUMBER: _ClassVar[int] PROPS_FIELD_NUMBER: _ClassVar[int] sessionId: str @@ -402,41 +417,41 @@ class SetPropsRequest(_message.Message): def __init__(self, sessionId: _Optional[str] = ..., props: _Optional[str] = ...) -> None: ... class SetPropsResponse(_message.Message): - __slots__ = [] + __slots__ = () def __init__(self) -> None: ... class GetAddCatalogsRequest(_message.Message): - __slots__ = ["sessionId"] + __slots__ = ("sessionId",) SESSIONID_FIELD_NUMBER: _ClassVar[int] sessionId: str def __init__(self, sessionId: _Optional[str] = ...) -> None: ... class AddCatalogsResponse(_message.Message): - __slots__ = [] + __slots__ = () def __init__(self) -> None: ... class GetCatalogesRequest(_message.Message): - __slots__ = [] + __slots__ = () def __init__(self) -> None: ... class GetCatalogesResponse(_message.Message): - __slots__ = ["catalogResponses"] + __slots__ = ("catalogResponses",) CATALOGRESPONSES_FIELD_NUMBER: _ClassVar[int] catalogResponses: _containers.RepeatedCompositeFieldContainer[CatalogResponse] def __init__(self, catalogResponses: _Optional[_Iterable[_Union[CatalogResponse, _Mapping]]] = ...) -> None: ... class RefreshCatalogsRequest(_message.Message): - __slots__ = ["sessionId"] + __slots__ = ("sessionId",) SESSIONID_FIELD_NUMBER: _ClassVar[int] sessionId: str def __init__(self, sessionId: _Optional[str] = ...) -> None: ... class RefreshCatalogsResponse(_message.Message): - __slots__ = [] + __slots__ = () def __init__(self) -> None: ... class RemoteChunkRequest(_message.Message): - __slots__ = ["originalQueryId", "remoteQueryId", "sQueryHash"] + __slots__ = ("originalQueryId", "remoteQueryId", "sQueryHash") ORIGINALQUERYID_FIELD_NUMBER: _ClassVar[int] REMOTEQUERYID_FIELD_NUMBER: _ClassVar[int] SQUERYHASH_FIELD_NUMBER: _ClassVar[int] @@ -446,7 +461,7 @@ class RemoteChunkRequest(_message.Message): def __init__(self, originalQueryId: _Optional[str] = ..., remoteQueryId: _Optional[str] = ..., sQueryHash: _Optional[str] = ...) -> None: ... class RemoteChunkResponse(_message.Message): - __slots__ = ["error", "chunk"] + __slots__ = ("error", "chunk") ERROR_FIELD_NUMBER: _ClassVar[int] CHUNK_FIELD_NUMBER: _ClassVar[int] error: str @@ -454,7 +469,7 @@ class RemoteChunkResponse(_message.Message): def __init__(self, error: _Optional[str] = ..., chunk: _Optional[bytes] = ...) -> None: ... class ClearOrCancelQueryRequest(_message.Message): - __slots__ = ["engineIP", "sessionId", "queryId"] + __slots__ = ("engineIP", "sessionId", "queryId") ENGINEIP_FIELD_NUMBER: _ClassVar[int] SESSIONID_FIELD_NUMBER: _ClassVar[int] QUERYID_FIELD_NUMBER: _ClassVar[int] @@ -464,5 +479,175 @@ class ClearOrCancelQueryRequest(_message.Message): def __init__(self, engineIP: _Optional[str] = ..., sessionId: _Optional[str] = ..., queryId: _Optional[str] = ...) -> None: ... class ClearOrCancelQueryResponse(_message.Message): - __slots__ = [] + __slots__ = () + def __init__(self) -> None: ... + +class CreateDataFrameRequest(_message.Message): + __slots__ = ("parquetFilePath", "catalog", "schema", "sessionId", "engineIP") + PARQUETFILEPATH_FIELD_NUMBER: _ClassVar[int] + CATALOG_FIELD_NUMBER: _ClassVar[int] + SCHEMA_FIELD_NUMBER: _ClassVar[int] + SESSIONID_FIELD_NUMBER: _ClassVar[int] + ENGINEIP_FIELD_NUMBER: _ClassVar[int] + parquetFilePath: str + catalog: str + schema: str + sessionId: str + engineIP: str + def __init__(self, parquetFilePath: _Optional[str] = ..., catalog: _Optional[str] = ..., schema: _Optional[str] = ..., sessionId: _Optional[str] = ..., engineIP: _Optional[str] = ...) -> None: ... + +class CreateDataFrameResponse(_message.Message): + __slots__ = ("queryId",) + QUERYID_FIELD_NUMBER: _ClassVar[int] + queryId: str + def __init__(self, queryId: _Optional[str] = ...) -> None: ... + +class ProjectionOnDataFrameRequest(_message.Message): + __slots__ = ("queryId", "sessionId", "field") + QUERYID_FIELD_NUMBER: _ClassVar[int] + SESSIONID_FIELD_NUMBER: _ClassVar[int] + FIELD_FIELD_NUMBER: _ClassVar[int] + queryId: str + sessionId: str + field: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, queryId: _Optional[str] = ..., sessionId: _Optional[str] = ..., field: _Optional[_Iterable[str]] = ...) -> None: ... + +class ProjectionOnDataFrameResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class FilterOnDataFrameRequest(_message.Message): + __slots__ = ("queryId", "sessionId", "whereClause") + QUERYID_FIELD_NUMBER: _ClassVar[int] + SESSIONID_FIELD_NUMBER: _ClassVar[int] + WHERECLAUSE_FIELD_NUMBER: _ClassVar[int] + queryId: str + sessionId: str + whereClause: str + def __init__(self, queryId: _Optional[str] = ..., sessionId: _Optional[str] = ..., whereClause: _Optional[str] = ...) -> None: ... + +class FilterOnDataFrameResponse(_message.Message): + __slots__ = () def __init__(self) -> None: ... + +class OrderByOnDataFrameRequest(_message.Message): + __slots__ = ("queryId", "sessionId", "field", "sortDirection", "nullsDirection") + QUERYID_FIELD_NUMBER: _ClassVar[int] + SESSIONID_FIELD_NUMBER: _ClassVar[int] + FIELD_FIELD_NUMBER: _ClassVar[int] + SORTDIRECTION_FIELD_NUMBER: _ClassVar[int] + NULLSDIRECTION_FIELD_NUMBER: _ClassVar[int] + queryId: str + sessionId: str + field: _containers.RepeatedScalarFieldContainer[str] + sortDirection: _containers.RepeatedScalarFieldContainer[SortDirection] + nullsDirection: _containers.RepeatedScalarFieldContainer[NullDirection] + def __init__(self, queryId: _Optional[str] = ..., sessionId: _Optional[str] = ..., field: _Optional[_Iterable[str]] = ..., sortDirection: _Optional[_Iterable[_Union[SortDirection, str]]] = ..., nullsDirection: _Optional[_Iterable[_Union[NullDirection, str]]] = ...) -> None: ... + +class OrderByOnDataFrameResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class LimitOnDataFrameRequest(_message.Message): + __slots__ = ("queryId", "sessionId", "fetchLimit") + QUERYID_FIELD_NUMBER: _ClassVar[int] + SESSIONID_FIELD_NUMBER: _ClassVar[int] + FETCHLIMIT_FIELD_NUMBER: _ClassVar[int] + queryId: str + sessionId: str + fetchLimit: int + def __init__(self, queryId: _Optional[str] = ..., sessionId: _Optional[str] = ..., fetchLimit: _Optional[int] = ...) -> None: ... + +class LimitOnDataFrameResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class ExecuteDataFrameRequest(_message.Message): + __slots__ = ("queryId", "sessionId") + QUERYID_FIELD_NUMBER: _ClassVar[int] + SESSIONID_FIELD_NUMBER: _ClassVar[int] + queryId: str + sessionId: str + def __init__(self, queryId: _Optional[str] = ..., sessionId: _Optional[str] = ...) -> None: ... + +class ExecuteDataFrameResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class DoubleRow(_message.Message): + __slots__ = ("values",) + VALUES_FIELD_NUMBER: _ClassVar[int] + values: _containers.RepeatedScalarFieldContainer[float] + def __init__(self, values: _Optional[_Iterable[float]] = ...) -> None: ... + +class DoubleMatrix(_message.Message): + __slots__ = ("rows",) + ROWS_FIELD_NUMBER: _ClassVar[int] + rows: _containers.RepeatedCompositeFieldContainer[DoubleRow] + def __init__(self, rows: _Optional[_Iterable[_Union[DoubleRow, _Mapping]]] = ...) -> None: ... + +class Task(_message.Message): + __slots__ = ("type", "sql_query", "model_id") + TYPE_FIELD_NUMBER: _ClassVar[int] + SQL_QUERY_FIELD_NUMBER: _ClassVar[int] + MODEL_ID_FIELD_NUMBER: _ClassVar[int] + type: str + sql_query: str + model_id: str + def __init__(self, type: _Optional[str] = ..., sql_query: _Optional[str] = ..., model_id: _Optional[str] = ...) -> None: ... + +class DAG(_message.Message): + __slots__ = ("tasks",) + TASKS_FIELD_NUMBER: _ClassVar[int] + tasks: _containers.RepeatedCompositeFieldContainer[Task] + def __init__(self, tasks: _Optional[_Iterable[_Union[Task, _Mapping]]] = ...) -> None: ... + +class ExecuteMLPipelineRequest(_message.Message): + __slots__ = ("session_id", "catalog", "schema", "dag") + SESSION_ID_FIELD_NUMBER: _ClassVar[int] + CATALOG_FIELD_NUMBER: _ClassVar[int] + SCHEMA_FIELD_NUMBER: _ClassVar[int] + DAG_FIELD_NUMBER: _ClassVar[int] + session_id: str + catalog: str + schema: str + dag: DAG + def __init__(self, session_id: _Optional[str] = ..., catalog: _Optional[str] = ..., schema: _Optional[str] = ..., dag: _Optional[_Union[DAG, _Mapping]] = ...) -> None: ... + +class ExecuteMLPipelineResponse(_message.Message): + __slots__ = ("status", "result") + STATUS_FIELD_NUMBER: _ClassVar[int] + RESULT_FIELD_NUMBER: _ClassVar[int] + status: str + result: DoubleMatrix + def __init__(self, status: _Optional[str] = ..., result: _Optional[_Union[DoubleMatrix, _Mapping]] = ...) -> None: ... + +class MatrixRequest(_message.Message): + __slots__ = ("operation", "matrix1", "rows1", "cols1", "matrix2", "rows2", "cols2") + OPERATION_FIELD_NUMBER: _ClassVar[int] + MATRIX1_FIELD_NUMBER: _ClassVar[int] + ROWS1_FIELD_NUMBER: _ClassVar[int] + COLS1_FIELD_NUMBER: _ClassVar[int] + MATRIX2_FIELD_NUMBER: _ClassVar[int] + ROWS2_FIELD_NUMBER: _ClassVar[int] + COLS2_FIELD_NUMBER: _ClassVar[int] + operation: str + matrix1: _containers.RepeatedScalarFieldContainer[float] + rows1: int + cols1: int + matrix2: _containers.RepeatedScalarFieldContainer[float] + rows2: int + cols2: int + def __init__(self, operation: _Optional[str] = ..., matrix1: _Optional[_Iterable[float]] = ..., rows1: _Optional[int] = ..., cols1: _Optional[int] = ..., matrix2: _Optional[_Iterable[float]] = ..., rows2: _Optional[int] = ..., cols2: _Optional[int] = ...) -> None: ... + +class MatrixResponse(_message.Message): + __slots__ = ("result", "rows", "cols", "status") + RESULT_FIELD_NUMBER: _ClassVar[int] + ROWS_FIELD_NUMBER: _ClassVar[int] + COLS_FIELD_NUMBER: _ClassVar[int] + STATUS_FIELD_NUMBER: _ClassVar[int] + result: _containers.RepeatedScalarFieldContainer[float] + rows: int + cols: int + status: str + def __init__(self, result: _Optional[_Iterable[float]] = ..., rows: _Optional[int] = ..., cols: _Optional[int] = ..., status: _Optional[str] = ...) -> None: ... diff --git a/e6data_python_connector/server/e6x_engine_pb2_grpc.py b/e6data_python_connector/server/e6x_engine_pb2_grpc.py index 4b3fbf3..3bcc954 100644 --- a/e6data_python_connector/server/e6x_engine_pb2_grpc.py +++ b/e6data_python_connector/server/e6x_engine_pb2_grpc.py @@ -1,8 +1,28 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings -import e6data_python_connector.server.e6x_engine_pb2 as e6x__engine__pb2 +from . import e6x_engine_pb2 as e6x__engine__pb2 + +GRPC_GENERATED_VERSION = '1.68.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in e6x_engine_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) class QueryEngineServiceStub(object): @@ -18,147 +38,187 @@ def __init__(self, channel): '/QueryEngineService/clear', request_serializer=e6x__engine__pb2.ClearRequest.SerializeToString, response_deserializer=e6x__engine__pb2.ClearResponse.FromString, - ) + _registered_method=True) self.cancelQuery = channel.unary_unary( '/QueryEngineService/cancelQuery', request_serializer=e6x__engine__pb2.CancelQueryRequest.SerializeToString, response_deserializer=e6x__engine__pb2.CancelQueryResponse.FromString, - ) + _registered_method=True) self.clearOrCancelQuery = channel.unary_unary( '/QueryEngineService/clearOrCancelQuery', request_serializer=e6x__engine__pb2.ClearOrCancelQueryRequest.SerializeToString, response_deserializer=e6x__engine__pb2.ClearOrCancelQueryResponse.FromString, - ) + _registered_method=True) self.explain = channel.unary_unary( '/QueryEngineService/explain', request_serializer=e6x__engine__pb2.ExplainRequest.SerializeToString, response_deserializer=e6x__engine__pb2.ExplainResponse.FromString, - ) + _registered_method=True) self.dryRun = channel.unary_unary( '/QueryEngineService/dryRun', request_serializer=e6x__engine__pb2.DryRunRequest.SerializeToString, response_deserializer=e6x__engine__pb2.DryRunResponse.FromString, - ) + _registered_method=True) self.dryRunV2 = channel.unary_unary( '/QueryEngineService/dryRunV2', request_serializer=e6x__engine__pb2.DryRunRequestV2.SerializeToString, response_deserializer=e6x__engine__pb2.DryRunResponse.FromString, - ) + _registered_method=True) self.explainAnalyze = channel.unary_unary( '/QueryEngineService/explainAnalyze', request_serializer=e6x__engine__pb2.ExplainAnalyzeRequest.SerializeToString, response_deserializer=e6x__engine__pb2.ExplainAnalyzeResponse.FromString, - ) + _registered_method=True) self.prepareStatement = channel.unary_unary( '/QueryEngineService/prepareStatement', request_serializer=e6x__engine__pb2.PrepareStatementRequest.SerializeToString, response_deserializer=e6x__engine__pb2.PrepareStatementResponse.FromString, - ) + _registered_method=True) self.prepareStatementV2 = channel.unary_unary( '/QueryEngineService/prepareStatementV2', request_serializer=e6x__engine__pb2.PrepareStatementV2Request.SerializeToString, response_deserializer=e6x__engine__pb2.PrepareStatementResponse.FromString, - ) + _registered_method=True) self.executeStatement = channel.unary_unary( '/QueryEngineService/executeStatement', request_serializer=e6x__engine__pb2.ExecuteStatementRequest.SerializeToString, response_deserializer=e6x__engine__pb2.ExecuteStatementResponse.FromString, - ) + _registered_method=True) self.executeStatementV2 = channel.unary_unary( '/QueryEngineService/executeStatementV2', request_serializer=e6x__engine__pb2.ExecuteStatementV2Request.SerializeToString, response_deserializer=e6x__engine__pb2.ExecuteStatementResponse.FromString, - ) + _registered_method=True) self.getNextResultRow = channel.unary_unary( '/QueryEngineService/getNextResultRow', request_serializer=e6x__engine__pb2.GetNextResultRowRequest.SerializeToString, response_deserializer=e6x__engine__pb2.GetNextResultRowResponse.FromString, - ) + _registered_method=True) self.getNextResultBatch = channel.unary_unary( '/QueryEngineService/getNextResultBatch', request_serializer=e6x__engine__pb2.GetNextResultBatchRequest.SerializeToString, response_deserializer=e6x__engine__pb2.GetNextResultBatchResponse.FromString, - ) + _registered_method=True) self.getResultMetadata = channel.unary_unary( '/QueryEngineService/getResultMetadata', request_serializer=e6x__engine__pb2.GetResultMetadataRequest.SerializeToString, response_deserializer=e6x__engine__pb2.GetResultMetadataResponse.FromString, - ) + _registered_method=True) self.authenticate = channel.unary_unary( '/QueryEngineService/authenticate', request_serializer=e6x__engine__pb2.AuthenticateRequest.SerializeToString, response_deserializer=e6x__engine__pb2.AuthenticateResponse.FromString, - ) + _registered_method=True) self.getTables = channel.unary_unary( '/QueryEngineService/getTables', request_serializer=e6x__engine__pb2.GetTablesRequest.SerializeToString, response_deserializer=e6x__engine__pb2.GetTablesResponse.FromString, - ) + _registered_method=True) self.getTablesV2 = channel.unary_unary( '/QueryEngineService/getTablesV2', request_serializer=e6x__engine__pb2.GetTablesV2Request.SerializeToString, response_deserializer=e6x__engine__pb2.GetTablesResponse.FromString, - ) + _registered_method=True) self.getSchemaNames = channel.unary_unary( '/QueryEngineService/getSchemaNames', request_serializer=e6x__engine__pb2.GetSchemaNamesRequest.SerializeToString, response_deserializer=e6x__engine__pb2.GetSchemaNamesResponse.FromString, - ) + _registered_method=True) self.getSchemaNamesV2 = channel.unary_unary( '/QueryEngineService/getSchemaNamesV2', request_serializer=e6x__engine__pb2.GetSchemaNamesV2Request.SerializeToString, response_deserializer=e6x__engine__pb2.GetSchemaNamesResponse.FromString, - ) + _registered_method=True) self.getColumns = channel.unary_unary( '/QueryEngineService/getColumns', request_serializer=e6x__engine__pb2.GetColumnsRequest.SerializeToString, response_deserializer=e6x__engine__pb2.GetColumnsResponse.FromString, - ) + _registered_method=True) self.getColumnsV2 = channel.unary_unary( '/QueryEngineService/getColumnsV2', request_serializer=e6x__engine__pb2.GetColumnsV2Request.SerializeToString, response_deserializer=e6x__engine__pb2.GetColumnsResponse.FromString, - ) + _registered_method=True) self.updateUsers = channel.unary_unary( '/QueryEngineService/updateUsers', request_serializer=e6x__engine__pb2.UpdateUsersRequest.SerializeToString, response_deserializer=e6x__engine__pb2.UpdateUsersResponse.FromString, - ) + _registered_method=True) self.setProps = channel.unary_unary( '/QueryEngineService/setProps', request_serializer=e6x__engine__pb2.SetPropsRequest.SerializeToString, response_deserializer=e6x__engine__pb2.SetPropsResponse.FromString, - ) + _registered_method=True) self.status = channel.unary_unary( '/QueryEngineService/status', request_serializer=e6x__engine__pb2.StatusRequest.SerializeToString, response_deserializer=e6x__engine__pb2.StatusResponse.FromString, - ) + _registered_method=True) self.addCatalogs = channel.unary_unary( '/QueryEngineService/addCatalogs', request_serializer=e6x__engine__pb2.AddCatalogsRequest.SerializeToString, response_deserializer=e6x__engine__pb2.AddCatalogsResponse.FromString, - ) + _registered_method=True) self.getAddCatalogsResponse = channel.unary_unary( '/QueryEngineService/getAddCatalogsResponse', request_serializer=e6x__engine__pb2.GetAddCatalogsRequest.SerializeToString, response_deserializer=e6x__engine__pb2.GetAddCatalogsResponse.FromString, - ) + _registered_method=True) self.getCataloges = channel.unary_unary( '/QueryEngineService/getCataloges', request_serializer=e6x__engine__pb2.GetCatalogesRequest.SerializeToString, response_deserializer=e6x__engine__pb2.GetCatalogesResponse.FromString, - ) + _registered_method=True) self.getNextRemoteCachedChunk = channel.unary_unary( '/QueryEngineService/getNextRemoteCachedChunk', request_serializer=e6x__engine__pb2.RemoteChunkRequest.SerializeToString, response_deserializer=e6x__engine__pb2.RemoteChunkResponse.FromString, - ) + _registered_method=True) self.refreshCatalogs = channel.unary_unary( '/QueryEngineService/refreshCatalogs', request_serializer=e6x__engine__pb2.RefreshCatalogsRequest.SerializeToString, response_deserializer=e6x__engine__pb2.RefreshCatalogsResponse.FromString, - ) + _registered_method=True) + self.createDataFrame = channel.unary_unary( + '/QueryEngineService/createDataFrame', + request_serializer=e6x__engine__pb2.CreateDataFrameRequest.SerializeToString, + response_deserializer=e6x__engine__pb2.CreateDataFrameResponse.FromString, + _registered_method=True) + self.projectionOnDataFrame = channel.unary_unary( + '/QueryEngineService/projectionOnDataFrame', + request_serializer=e6x__engine__pb2.ProjectionOnDataFrameRequest.SerializeToString, + response_deserializer=e6x__engine__pb2.ProjectionOnDataFrameResponse.FromString, + _registered_method=True) + self.filterOnDataFrame = channel.unary_unary( + '/QueryEngineService/filterOnDataFrame', + request_serializer=e6x__engine__pb2.FilterOnDataFrameRequest.SerializeToString, + response_deserializer=e6x__engine__pb2.FilterOnDataFrameResponse.FromString, + _registered_method=True) + self.orderByOnDataFrame = channel.unary_unary( + '/QueryEngineService/orderByOnDataFrame', + request_serializer=e6x__engine__pb2.OrderByOnDataFrameRequest.SerializeToString, + response_deserializer=e6x__engine__pb2.OrderByOnDataFrameResponse.FromString, + _registered_method=True) + self.limitOnDataFrame = channel.unary_unary( + '/QueryEngineService/limitOnDataFrame', + request_serializer=e6x__engine__pb2.LimitOnDataFrameRequest.SerializeToString, + response_deserializer=e6x__engine__pb2.LimitOnDataFrameResponse.FromString, + _registered_method=True) + self.executeDataFrame = channel.unary_unary( + '/QueryEngineService/executeDataFrame', + request_serializer=e6x__engine__pb2.ExecuteDataFrameRequest.SerializeToString, + response_deserializer=e6x__engine__pb2.ExecuteDataFrameResponse.FromString, + _registered_method=True) + self.executeMLPipeline = channel.unary_unary( + '/QueryEngineService/executeMLPipeline', + request_serializer=e6x__engine__pb2.ExecuteMLPipelineRequest.SerializeToString, + response_deserializer=e6x__engine__pb2.ExecuteMLPipelineResponse.FromString, + _registered_method=True) + self.ComputeMatrix = channel.unary_unary( + '/QueryEngineService/ComputeMatrix', + request_serializer=e6x__engine__pb2.MatrixRequest.SerializeToString, + response_deserializer=e6x__engine__pb2.MatrixResponse.FromString, + _registered_method=True) class QueryEngineServiceServicer(object): @@ -339,6 +399,56 @@ def refreshCatalogs(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def createDataFrame(self, request, context): + """dataframe + + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def projectionOnDataFrame(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def filterOnDataFrame(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def orderByOnDataFrame(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def limitOnDataFrame(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def executeDataFrame(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def executeMLPipeline(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ComputeMatrix(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_QueryEngineServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -487,10 +597,51 @@ def add_QueryEngineServiceServicer_to_server(servicer, server): request_deserializer=e6x__engine__pb2.RefreshCatalogsRequest.FromString, response_serializer=e6x__engine__pb2.RefreshCatalogsResponse.SerializeToString, ), + 'createDataFrame': grpc.unary_unary_rpc_method_handler( + servicer.createDataFrame, + request_deserializer=e6x__engine__pb2.CreateDataFrameRequest.FromString, + response_serializer=e6x__engine__pb2.CreateDataFrameResponse.SerializeToString, + ), + 'projectionOnDataFrame': grpc.unary_unary_rpc_method_handler( + servicer.projectionOnDataFrame, + request_deserializer=e6x__engine__pb2.ProjectionOnDataFrameRequest.FromString, + response_serializer=e6x__engine__pb2.ProjectionOnDataFrameResponse.SerializeToString, + ), + 'filterOnDataFrame': grpc.unary_unary_rpc_method_handler( + servicer.filterOnDataFrame, + request_deserializer=e6x__engine__pb2.FilterOnDataFrameRequest.FromString, + response_serializer=e6x__engine__pb2.FilterOnDataFrameResponse.SerializeToString, + ), + 'orderByOnDataFrame': grpc.unary_unary_rpc_method_handler( + servicer.orderByOnDataFrame, + request_deserializer=e6x__engine__pb2.OrderByOnDataFrameRequest.FromString, + response_serializer=e6x__engine__pb2.OrderByOnDataFrameResponse.SerializeToString, + ), + 'limitOnDataFrame': grpc.unary_unary_rpc_method_handler( + servicer.limitOnDataFrame, + request_deserializer=e6x__engine__pb2.LimitOnDataFrameRequest.FromString, + response_serializer=e6x__engine__pb2.LimitOnDataFrameResponse.SerializeToString, + ), + 'executeDataFrame': grpc.unary_unary_rpc_method_handler( + servicer.executeDataFrame, + request_deserializer=e6x__engine__pb2.ExecuteDataFrameRequest.FromString, + response_serializer=e6x__engine__pb2.ExecuteDataFrameResponse.SerializeToString, + ), + 'executeMLPipeline': grpc.unary_unary_rpc_method_handler( + servicer.executeMLPipeline, + request_deserializer=e6x__engine__pb2.ExecuteMLPipelineRequest.FromString, + response_serializer=e6x__engine__pb2.ExecuteMLPipelineResponse.SerializeToString, + ), + 'ComputeMatrix': grpc.unary_unary_rpc_method_handler( + servicer.ComputeMatrix, + request_deserializer=e6x__engine__pb2.MatrixRequest.FromString, + response_serializer=e6x__engine__pb2.MatrixResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'QueryEngineService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('QueryEngineService', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -508,11 +659,21 @@ def clear(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/clear', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/clear', e6x__engine__pb2.ClearRequest.SerializeToString, e6x__engine__pb2.ClearResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def cancelQuery(request, @@ -525,11 +686,21 @@ def cancelQuery(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/cancelQuery', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/cancelQuery', e6x__engine__pb2.CancelQueryRequest.SerializeToString, e6x__engine__pb2.CancelQueryResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def clearOrCancelQuery(request, @@ -542,11 +713,21 @@ def clearOrCancelQuery(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/clearOrCancelQuery', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/clearOrCancelQuery', e6x__engine__pb2.ClearOrCancelQueryRequest.SerializeToString, e6x__engine__pb2.ClearOrCancelQueryResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def explain(request, @@ -559,11 +740,21 @@ def explain(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/explain', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/explain', e6x__engine__pb2.ExplainRequest.SerializeToString, e6x__engine__pb2.ExplainResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def dryRun(request, @@ -576,11 +767,21 @@ def dryRun(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/dryRun', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/dryRun', e6x__engine__pb2.DryRunRequest.SerializeToString, e6x__engine__pb2.DryRunResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def dryRunV2(request, @@ -593,11 +794,21 @@ def dryRunV2(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/dryRunV2', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/dryRunV2', e6x__engine__pb2.DryRunRequestV2.SerializeToString, e6x__engine__pb2.DryRunResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def explainAnalyze(request, @@ -610,11 +821,21 @@ def explainAnalyze(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/explainAnalyze', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/explainAnalyze', e6x__engine__pb2.ExplainAnalyzeRequest.SerializeToString, e6x__engine__pb2.ExplainAnalyzeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def prepareStatement(request, @@ -627,11 +848,21 @@ def prepareStatement(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/prepareStatement', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/prepareStatement', e6x__engine__pb2.PrepareStatementRequest.SerializeToString, e6x__engine__pb2.PrepareStatementResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def prepareStatementV2(request, @@ -644,11 +875,21 @@ def prepareStatementV2(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/prepareStatementV2', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/prepareStatementV2', e6x__engine__pb2.PrepareStatementV2Request.SerializeToString, e6x__engine__pb2.PrepareStatementResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def executeStatement(request, @@ -661,11 +902,21 @@ def executeStatement(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/executeStatement', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/executeStatement', e6x__engine__pb2.ExecuteStatementRequest.SerializeToString, e6x__engine__pb2.ExecuteStatementResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def executeStatementV2(request, @@ -678,11 +929,21 @@ def executeStatementV2(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/executeStatementV2', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/executeStatementV2', e6x__engine__pb2.ExecuteStatementV2Request.SerializeToString, e6x__engine__pb2.ExecuteStatementResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getNextResultRow(request, @@ -695,11 +956,21 @@ def getNextResultRow(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getNextResultRow', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getNextResultRow', e6x__engine__pb2.GetNextResultRowRequest.SerializeToString, e6x__engine__pb2.GetNextResultRowResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getNextResultBatch(request, @@ -712,11 +983,21 @@ def getNextResultBatch(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getNextResultBatch', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getNextResultBatch', e6x__engine__pb2.GetNextResultBatchRequest.SerializeToString, e6x__engine__pb2.GetNextResultBatchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getResultMetadata(request, @@ -729,11 +1010,21 @@ def getResultMetadata(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getResultMetadata', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getResultMetadata', e6x__engine__pb2.GetResultMetadataRequest.SerializeToString, e6x__engine__pb2.GetResultMetadataResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def authenticate(request, @@ -746,11 +1037,21 @@ def authenticate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/authenticate', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/authenticate', e6x__engine__pb2.AuthenticateRequest.SerializeToString, e6x__engine__pb2.AuthenticateResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getTables(request, @@ -763,11 +1064,21 @@ def getTables(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getTables', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getTables', e6x__engine__pb2.GetTablesRequest.SerializeToString, e6x__engine__pb2.GetTablesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getTablesV2(request, @@ -780,11 +1091,21 @@ def getTablesV2(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getTablesV2', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getTablesV2', e6x__engine__pb2.GetTablesV2Request.SerializeToString, e6x__engine__pb2.GetTablesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getSchemaNames(request, @@ -797,11 +1118,21 @@ def getSchemaNames(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getSchemaNames', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getSchemaNames', e6x__engine__pb2.GetSchemaNamesRequest.SerializeToString, e6x__engine__pb2.GetSchemaNamesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getSchemaNamesV2(request, @@ -814,11 +1145,21 @@ def getSchemaNamesV2(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getSchemaNamesV2', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getSchemaNamesV2', e6x__engine__pb2.GetSchemaNamesV2Request.SerializeToString, e6x__engine__pb2.GetSchemaNamesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getColumns(request, @@ -831,11 +1172,21 @@ def getColumns(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getColumns', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getColumns', e6x__engine__pb2.GetColumnsRequest.SerializeToString, e6x__engine__pb2.GetColumnsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getColumnsV2(request, @@ -848,11 +1199,21 @@ def getColumnsV2(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getColumnsV2', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getColumnsV2', e6x__engine__pb2.GetColumnsV2Request.SerializeToString, e6x__engine__pb2.GetColumnsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def updateUsers(request, @@ -865,11 +1226,21 @@ def updateUsers(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/updateUsers', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/updateUsers', e6x__engine__pb2.UpdateUsersRequest.SerializeToString, e6x__engine__pb2.UpdateUsersResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def setProps(request, @@ -882,11 +1253,21 @@ def setProps(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/setProps', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/setProps', e6x__engine__pb2.SetPropsRequest.SerializeToString, e6x__engine__pb2.SetPropsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def status(request, @@ -899,11 +1280,21 @@ def status(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/status', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/status', e6x__engine__pb2.StatusRequest.SerializeToString, e6x__engine__pb2.StatusResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def addCatalogs(request, @@ -916,11 +1307,21 @@ def addCatalogs(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/addCatalogs', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/addCatalogs', e6x__engine__pb2.AddCatalogsRequest.SerializeToString, e6x__engine__pb2.AddCatalogsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getAddCatalogsResponse(request, @@ -933,11 +1334,21 @@ def getAddCatalogsResponse(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getAddCatalogsResponse', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getAddCatalogsResponse', e6x__engine__pb2.GetAddCatalogsRequest.SerializeToString, e6x__engine__pb2.GetAddCatalogsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getCataloges(request, @@ -950,11 +1361,21 @@ def getCataloges(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getCataloges', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getCataloges', e6x__engine__pb2.GetCatalogesRequest.SerializeToString, e6x__engine__pb2.GetCatalogesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def getNextRemoteCachedChunk(request, @@ -967,11 +1388,21 @@ def getNextRemoteCachedChunk(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/getNextRemoteCachedChunk', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/getNextRemoteCachedChunk', e6x__engine__pb2.RemoteChunkRequest.SerializeToString, e6x__engine__pb2.RemoteChunkResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def refreshCatalogs(request, @@ -984,8 +1415,234 @@ def refreshCatalogs(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/QueryEngineService/refreshCatalogs', + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/refreshCatalogs', e6x__engine__pb2.RefreshCatalogsRequest.SerializeToString, e6x__engine__pb2.RefreshCatalogsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def createDataFrame(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/createDataFrame', + e6x__engine__pb2.CreateDataFrameRequest.SerializeToString, + e6x__engine__pb2.CreateDataFrameResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def projectionOnDataFrame(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/projectionOnDataFrame', + e6x__engine__pb2.ProjectionOnDataFrameRequest.SerializeToString, + e6x__engine__pb2.ProjectionOnDataFrameResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def filterOnDataFrame(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/filterOnDataFrame', + e6x__engine__pb2.FilterOnDataFrameRequest.SerializeToString, + e6x__engine__pb2.FilterOnDataFrameResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def orderByOnDataFrame(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/orderByOnDataFrame', + e6x__engine__pb2.OrderByOnDataFrameRequest.SerializeToString, + e6x__engine__pb2.OrderByOnDataFrameResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def limitOnDataFrame(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/limitOnDataFrame', + e6x__engine__pb2.LimitOnDataFrameRequest.SerializeToString, + e6x__engine__pb2.LimitOnDataFrameResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def executeDataFrame(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/executeDataFrame', + e6x__engine__pb2.ExecuteDataFrameRequest.SerializeToString, + e6x__engine__pb2.ExecuteDataFrameResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def executeMLPipeline(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/executeMLPipeline', + e6x__engine__pb2.ExecuteMLPipelineRequest.SerializeToString, + e6x__engine__pb2.ExecuteMLPipelineResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ComputeMatrix(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/QueryEngineService/ComputeMatrix', + e6x__engine__pb2.MatrixRequest.SerializeToString, + e6x__engine__pb2.MatrixResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/e6x_engine.proto b/e6x_engine.proto index d2b30b5..2549418 100644 --- a/e6x_engine.proto +++ b/e6x_engine.proto @@ -297,6 +297,134 @@ message ClearOrCancelQueryRequest{ message ClearOrCancelQueryResponse{ } +// DataFrame +message CreateDataFrameRequest +{ + string parquetFilePath = 1; + string catalog = 2; + string schema = 3; + string sessionId = 4; + string engineIP = 5; +} + +message CreateDataFrameResponse +{ + string queryId = 1; +} + +message ProjectionOnDataFrameRequest +{ + string queryId = 1; + string sessionId = 2; + repeated string field = 3; +} + +message ProjectionOnDataFrameResponse {} + +message FilterOnDataFrameRequest +{ + string queryId = 1; + string sessionId = 2; + string whereClause = 3; +} + +message FilterOnDataFrameResponse {} + +enum SortDirection +{ + ASC = 0; + DESC = 1; +} + +enum NullDirection +{ + FIRST = 0; + LAST = 1; +} + +message OrderByOnDataFrameRequest +{ + string queryId = 1; + string sessionId = 2; + repeated string field = 3; + repeated SortDirection sortDirection = 4; + repeated NullDirection nullsDirection = 5; +} + +message OrderByOnDataFrameResponse {} + +message LimitOnDataFrameRequest +{ + string queryId = 1; + string sessionId = 2; + int32 fetchLimit = 3; +} + +message LimitOnDataFrameResponse {} + +message ExecuteDataFrameRequest +{ + string queryId = 1; + string sessionId = 2; +} + +message ExecuteDataFrameResponse {} + +// Define a row of doubles +message DoubleRow { + repeated double values = 1; // Represents a row in the 2D array +} + +// Define a 2D array of doubles +message DoubleMatrix { + repeated DoubleRow rows = 1; // Represents all rows in the 2D array +} + +// Represents an individual task in the DAG +message Task { + string type = 1; // Task type: "train", "predict" + string sql_query = 2; // SQL query for the task + string model_id = 3; // Optional: Model ID for prediction tasks +} + +// Represents the full DAG as a list of tasks +message DAG { + repeated Task tasks = 1; // List of tasks in the DAG +} + +// Request to execute the DAG +message ExecuteMLPipelineRequest { + string session_id = 1; // Unique session ID + string catalog = 2; + string schema = 3; + DAG dag = 4; // The DAG to execute +} + +// Response after DAG execution +message ExecuteMLPipelineResponse { + string status = 1; // Status of execution + DoubleMatrix result = 2; // Serialized result (e.g., predictions or output) +} + +// Matrix request message +message MatrixRequest { + string operation = 1; // Operation type: "add", "multiply", etc. + repeated double matrix1 = 2; // Flattened row-major matrix1 + int32 rows1 = 3; // Number of rows in matrix1 + int32 cols1 = 4; // Number of columns in matrix1 + repeated double matrix2 = 5; // Flattened row-major matrix2 + optional int32 rows2 = 6; // Number of rows in matrix2 + optional int32 cols2 = 7; // Number of columns in matrix2 +} + +// Matrix response message +message MatrixResponse { + repeated double result = 1; // Flattened row-major result matrix + int32 rows = 2; // Number of rows in result matrix + int32 cols = 3; // Number of columns in result matrix + string status = 4; // Status message (e.g., "success") +} + service QueryEngineService { rpc clear(ClearRequest) returns (ClearResponse); @@ -355,4 +483,23 @@ service QueryEngineService { rpc getNextRemoteCachedChunk(RemoteChunkRequest) returns (RemoteChunkResponse); rpc refreshCatalogs(RefreshCatalogsRequest) returns (RefreshCatalogsResponse); + + // dataframe + + rpc createDataFrame(CreateDataFrameRequest) returns (CreateDataFrameResponse); + + rpc projectionOnDataFrame(ProjectionOnDataFrameRequest) returns (ProjectionOnDataFrameResponse); + + rpc filterOnDataFrame(FilterOnDataFrameRequest) returns (FilterOnDataFrameResponse); + + rpc orderByOnDataFrame(OrderByOnDataFrameRequest) returns (OrderByOnDataFrameResponse); + + rpc limitOnDataFrame(LimitOnDataFrameRequest) returns (LimitOnDataFrameResponse); + + rpc executeDataFrame(ExecuteDataFrameRequest) returns (ExecuteDataFrameResponse); + + rpc executeMLPipeline(ExecuteMLPipelineRequest) returns (ExecuteMLPipelineResponse); + + rpc ComputeMatrix (MatrixRequest) returns (MatrixResponse); + } \ No newline at end of file