@@ -756,11 +756,13 @@ def _results_message_to_execute_response(self, resp, operation_state):
756756 )
757757 direct_results = resp .directResults
758758 has_been_closed_server_side = direct_results and direct_results .closeOperation
759+
759760 has_more_rows = (
760761 (not direct_results )
761762 or (not direct_results .resultSet )
762763 or direct_results .resultSet .hasMoreRows
763764 )
765+
764766 description = self ._hive_schema_to_description (
765767 t_result_set_metadata_resp .schema
766768 )
@@ -782,18 +784,19 @@ def _results_message_to_execute_response(self, resp, operation_state):
782784 if status is None :
783785 raise ValueError (f"Unknown command state: { operation_state } " )
784786
785- return ExecuteResponse (
787+ execute_response = ExecuteResponse (
786788 command_id = command_id ,
787789 status = status ,
788790 description = description ,
789- has_more_rows = has_more_rows ,
790791 has_been_closed_server_side = has_been_closed_server_side ,
791792 lz4_compressed = lz4_compressed ,
792793 is_staging_operation = t_result_set_metadata_resp .isStagingOperation ,
793794 arrow_schema_bytes = schema_bytes ,
794795 result_format = t_result_set_metadata_resp .resultFormat ,
795796 )
796797
798+ return execute_response , has_more_rows
799+
797800 def get_execution_result (
798801 self , command_id : CommandId , cursor : "Cursor"
799802 ) -> "ResultSet" :
@@ -842,7 +845,6 @@ def get_execution_result(
842845 command_id = command_id ,
843846 status = status ,
844847 description = description ,
845- has_more_rows = has_more_rows ,
846848 has_been_closed_server_side = False ,
847849 lz4_compressed = lz4_compressed ,
848850 is_staging_operation = is_staging_operation ,
@@ -860,6 +862,7 @@ def get_execution_result(
860862 t_row_set = resp .results ,
861863 max_download_threads = self .max_download_threads ,
862864 ssl_options = self ._ssl_options ,
865+ has_more_rows = has_more_rows ,
863866 )
864867
865868 def _wait_until_command_done (self , op_handle , initial_operation_status_resp ):
@@ -972,7 +975,9 @@ def execute_command(
972975 self ._handle_execute_response_async (resp , cursor )
973976 return None
974977 else :
975- execute_response = self ._handle_execute_response (resp , cursor )
978+ execute_response , has_more_rows = self ._handle_execute_response (
979+ resp , cursor
980+ )
976981
977982 t_row_set = None
978983 if resp .directResults and resp .directResults .resultSet :
@@ -988,6 +993,7 @@ def execute_command(
988993 t_row_set = t_row_set ,
989994 max_download_threads = self .max_download_threads ,
990995 ssl_options = self ._ssl_options ,
996+ has_more_rows = has_more_rows ,
991997 )
992998
993999 def get_catalogs (
@@ -1009,7 +1015,7 @@ def get_catalogs(
10091015 )
10101016 resp = self .make_request (self ._client .GetCatalogs , req )
10111017
1012- execute_response = self ._handle_execute_response (resp , cursor )
1018+ execute_response , has_more_rows = self ._handle_execute_response (resp , cursor )
10131019
10141020 t_row_set = None
10151021 if resp .directResults and resp .directResults .resultSet :
@@ -1025,6 +1031,7 @@ def get_catalogs(
10251031 t_row_set = t_row_set ,
10261032 max_download_threads = self .max_download_threads ,
10271033 ssl_options = self ._ssl_options ,
1034+ has_more_rows = has_more_rows ,
10281035 )
10291036
10301037 def get_schemas (
@@ -1050,7 +1057,7 @@ def get_schemas(
10501057 )
10511058 resp = self .make_request (self ._client .GetSchemas , req )
10521059
1053- execute_response = self ._handle_execute_response (resp , cursor )
1060+ execute_response , has_more_rows = self ._handle_execute_response (resp , cursor )
10541061
10551062 t_row_set = None
10561063 if resp .directResults and resp .directResults .resultSet :
@@ -1066,6 +1073,7 @@ def get_schemas(
10661073 t_row_set = t_row_set ,
10671074 max_download_threads = self .max_download_threads ,
10681075 ssl_options = self ._ssl_options ,
1076+ has_more_rows = has_more_rows ,
10691077 )
10701078
10711079 def get_tables (
@@ -1095,7 +1103,7 @@ def get_tables(
10951103 )
10961104 resp = self .make_request (self ._client .GetTables , req )
10971105
1098- execute_response = self ._handle_execute_response (resp , cursor )
1106+ execute_response , has_more_rows = self ._handle_execute_response (resp , cursor )
10991107
11001108 t_row_set = None
11011109 if resp .directResults and resp .directResults .resultSet :
@@ -1111,6 +1119,7 @@ def get_tables(
11111119 t_row_set = t_row_set ,
11121120 max_download_threads = self .max_download_threads ,
11131121 ssl_options = self ._ssl_options ,
1122+ has_more_rows = has_more_rows ,
11141123 )
11151124
11161125 def get_columns (
@@ -1140,7 +1149,7 @@ def get_columns(
11401149 )
11411150 resp = self .make_request (self ._client .GetColumns , req )
11421151
1143- execute_response = self ._handle_execute_response (resp , cursor )
1152+ execute_response , has_more_rows = self ._handle_execute_response (resp , cursor )
11441153
11451154 t_row_set = None
11461155 if resp .directResults and resp .directResults .resultSet :
@@ -1156,6 +1165,7 @@ def get_columns(
11561165 t_row_set = t_row_set ,
11571166 max_download_threads = self .max_download_threads ,
11581167 ssl_options = self ._ssl_options ,
1168+ has_more_rows = has_more_rows ,
11591169 )
11601170
11611171 def _handle_execute_response (self , resp , cursor ):
0 commit comments