@@ -969,7 +969,13 @@ def execute_command(
969969 parameters = [],
970970 async_op = False ,
971971 enforce_embedded_schema_correctness = False ,
972+ << << << < HEAD
972973 row_limit : Optional [int ] = None ,
974+ | | | | | | | 576 eafc
975+ ):
976+ assert session_handle is not None
977+ == == == =
978+ >> >> >> > main
973979 ) -> Union ["ResultSet" , None ]:
974980 thrift_handle = session_id .to_thrift_handle ()
975981 if not thrift_handle :
@@ -1018,10 +1024,17 @@ def execute_command(
10181024 self ._handle_execute_response_async (resp , cursor )
10191025 return None
10201026 else :
1027+ < << << << HEAD
10211028 execute_response , is_direct_results = self ._handle_execute_response (
10221029 resp , cursor
10231030 )
1031+ | | | | | | | 576 eafc
1032+ return self ._handle_execute_response (resp , cursor )
1033+ == == == =
1034+ execute_response = self ._handle_execute_response (resp , cursor )
1035+ >> >> >> > main
10241036
1037+ < << << << HEAD
10251038 t_row_set = None
10261039 if resp .directResults and resp .directResults .resultSet :
10271040 t_row_set = resp .directResults .resultSet .results
@@ -1045,6 +1058,26 @@ def get_catalogs(
10451058 max_rows : int ,
10461059 max_bytes : int ,
10471060 cursor : "Cursor" ,
1061+ | | | | | | | 576 eafc
1062+ def get_catalogs (self , session_handle , max_rows , max_bytes , cursor ):
1063+ assert session_handle is not None
1064+ == == == =
1065+ return ThriftResultSet (
1066+ connection = cursor .connection ,
1067+ execute_response = execute_response ,
1068+ thrift_client = self ,
1069+ buffer_size_bytes = max_bytes ,
1070+ arraysize = max_rows ,
1071+ use_cloud_fetch = use_cloud_fetch ,
1072+ )
1073+
1074+ def get_catalogs (
1075+ self ,
1076+ session_id : SessionId ,
1077+ max_rows : int ,
1078+ max_bytes : int ,
1079+ cursor : Cursor ,
1080+ >> >> >> > main
10481081 ) - > "ResultSet" :
10491082 thrift_handle = session_id .to_thrift_handle ()
10501083 if not thrift_handle :
@@ -1058,6 +1091,7 @@ def get_catalogs(
10581091 )
10591092 resp = self .make_request (self ._client .GetCatalogs , req )
10601093
1094+ << << << < HEAD
10611095 execute_response , is_direct_results = self ._handle_execute_response (
10621096 resp , cursor
10631097 )
@@ -1077,6 +1111,19 @@ def get_catalogs(
10771111 max_download_threads = self .max_download_threads ,
10781112 ssl_options = self ._ssl_options ,
10791113 is_direct_results = is_direct_results ,
1114+ | | | | | | | 576 eafc
1115+ return self ._handle_execute_response (resp , cursor )
1116+ == == == =
1117+ execute_response = self ._handle_execute_response (resp , cursor )
1118+
1119+ return ThriftResultSet (
1120+ connection = cursor .connection ,
1121+ execute_response = execute_response ,
1122+ thrift_client = self ,
1123+ buffer_size_bytes = max_bytes ,
1124+ arraysize = max_rows ,
1125+ use_cloud_fetch = cursor .connection .use_cloud_fetch ,
1126+ >> >> >> > main
10801127 )
10811128
10821129 def get_schemas (
@@ -1088,8 +1135,14 @@ def get_schemas(
10881135 catalog_name = None ,
10891136 schema_name = None ,
10901137 ) - > "ResultSet" :
1138+ << << << < HEAD
10911139 from databricks .sql .result_set import ThriftResultSet
10921140
1141+ | | | | | | | 576 eafc
1142+ ):
1143+ assert session_handle is not None
1144+ == == == =
1145+ >> >> >> > main
10931146 thrift_handle = session_id .to_thrift_handle ()
10941147 if not thrift_handle :
10951148 raise ValueError ("Not a valid Thrift session ID" )
@@ -1104,6 +1157,7 @@ def get_schemas(
11041157 )
11051158 resp = self .make_request (self ._client .GetSchemas , req )
11061159
1160+ << << << < HEAD
11071161 execute_response , is_direct_results = self ._handle_execute_response (
11081162 resp , cursor
11091163 )
@@ -1123,6 +1177,19 @@ def get_schemas(
11231177 max_download_threads = self .max_download_threads ,
11241178 ssl_options = self ._ssl_options ,
11251179 is_direct_results = is_direct_results ,
1180+ | | | | | | | 576 eafc
1181+ return self ._handle_execute_response (resp , cursor )
1182+ == == == =
1183+ execute_response = self ._handle_execute_response (resp , cursor )
1184+
1185+ return ThriftResultSet (
1186+ connection = cursor .connection ,
1187+ execute_response = execute_response ,
1188+ thrift_client = self ,
1189+ buffer_size_bytes = max_bytes ,
1190+ arraysize = max_rows ,
1191+ use_cloud_fetch = cursor .connection .use_cloud_fetch ,
1192+ >> >> >> > main
11261193 )
11271194
11281195 def get_tables (
@@ -1136,8 +1203,14 @@ def get_tables(
11361203 table_name = None ,
11371204 table_types = None ,
11381205 ) - > "ResultSet" :
1206+ << << << < HEAD
11391207 from databricks .sql .result_set import ThriftResultSet
11401208
1209+ | | | | | | | 576 eafc
1210+ ):
1211+ assert session_handle is not None
1212+ == == == =
1213+ >> >> >> > main
11411214 thrift_handle = session_id .to_thrift_handle ()
11421215 if not thrift_handle :
11431216 raise ValueError ("Not a valid Thrift session ID" )
@@ -1154,6 +1227,7 @@ def get_tables(
11541227 )
11551228 resp = self .make_request (self ._client .GetTables , req )
11561229
1230+ << << << < HEAD
11571231 execute_response , is_direct_results = self ._handle_execute_response (
11581232 resp , cursor
11591233 )
@@ -1173,6 +1247,19 @@ def get_tables(
11731247 max_download_threads = self .max_download_threads ,
11741248 ssl_options = self ._ssl_options ,
11751249 is_direct_results = is_direct_results ,
1250+ | | | | | | | 576 eafc
1251+ return self ._handle_execute_response (resp , cursor )
1252+ == == == =
1253+ execute_response = self ._handle_execute_response (resp , cursor )
1254+
1255+ return ThriftResultSet (
1256+ connection = cursor .connection ,
1257+ execute_response = execute_response ,
1258+ thrift_client = self ,
1259+ buffer_size_bytes = max_bytes ,
1260+ arraysize = max_rows ,
1261+ use_cloud_fetch = cursor .connection .use_cloud_fetch ,
1262+ >> >> >> > main
11761263 )
11771264
11781265 def get_columns (
@@ -1186,8 +1273,14 @@ def get_columns(
11861273 table_name = None ,
11871274 column_name = None ,
11881275 ) - > "ResultSet" :
1276+ << << << < HEAD
11891277 from databricks .sql .result_set import ThriftResultSet
11901278
1279+ | | | | | | | 576 eafc
1280+ ):
1281+ assert session_handle is not None
1282+ == == == =
1283+ >> >> >> > main
11911284 thrift_handle = session_id .to_thrift_handle ()
11921285 if not thrift_handle :
11931286 raise ValueError ("Not a valid Thrift session ID" )
@@ -1204,6 +1297,7 @@ def get_columns(
12041297 )
12051298 resp = self .make_request (self ._client .GetColumns , req )
12061299
1300+ << << << < HEAD
12071301 execute_response , is_direct_results = self ._handle_execute_response (
12081302 resp , cursor
12091303 )
@@ -1223,6 +1317,19 @@ def get_columns(
12231317 max_download_threads = self .max_download_threads ,
12241318 ssl_options = self ._ssl_options ,
12251319 is_direct_results = is_direct_results ,
1320+ | | | | | | | 576 eafc
1321+ return self ._handle_execute_response (resp , cursor )
1322+ == == == =
1323+ execute_response = self ._handle_execute_response (resp , cursor )
1324+
1325+ return ThriftResultSet (
1326+ connection = cursor .connection ,
1327+ execute_response = execute_response ,
1328+ thrift_client = self ,
1329+ buffer_size_bytes = max_bytes ,
1330+ arraysize = max_rows ,
1331+ use_cloud_fetch = cursor .connection .use_cloud_fetch ,
1332+ >> >> >> > main
12261333 )
12271334
12281335 def _handle_execute_response (self , resp , cursor ):
0 commit comments