@@ -49,32 +49,26 @@ def _filter_sea_result_set(
4949 Returns:
5050 A filtered SEA result set
5151 """
52- # Get all remaining rows
53- original_index = result_set .results .cur_row_index
54- result_set .results .cur_row_index = 0 # Reset to beginning
52+ # Get all remaining rows from the current position (JDBC-aligned behavior)
53+ # Note: This will only filter rows that haven't been read yet
5554 all_rows = result_set .results .remaining_rows ()
5655
5756 # Filter rows
5857 filtered_rows = [row for row in all_rows if filter_func (row )]
5958
60- # Import SeaResultSet here to avoid circular imports
61- from databricks .sql .result_set import SeaResultSet
62-
63- # Reuse the command_id from the original result set
64- command_id = result_set .command_id
65-
66- # Create an ExecuteResponse with the filtered data
6759 execute_response = ExecuteResponse (
68- command_id = command_id ,
60+ command_id = result_set . command_id ,
6961 status = result_set .status ,
7062 description = result_set .description ,
71- has_more_rows = result_set ._has_more_rows ,
63+ has_more_rows = result_set .has_more_rows ,
7264 results_queue = JsonQueue (filtered_rows ),
7365 has_been_closed_server_side = result_set .has_been_closed_server_side ,
7466 lz4_compressed = False ,
7567 is_staging_operation = False ,
7668 )
7769
70+ from databricks .sql .result_set import SeaResultSet
71+
7872 return SeaResultSet (
7973 connection = result_set .connection ,
8074 execute_response = execute_response ,
0 commit comments