@@ -552,43 +552,6 @@ def fetchall_json(self):
552
552
553
553
return results
554
554
555
- def _convert_complex_types_to_string (
556
- self , rows : "pyarrow.Table"
557
- ) -> "pyarrow.Table" :
558
- """
559
- Convert complex types (array, struct, map) to string representation.
560
-
561
- Args:
562
- rows: Input PyArrow table
563
-
564
- Returns:
565
- PyArrow table with complex types converted to strings
566
- """
567
-
568
- if not pyarrow :
569
- return rows
570
-
571
- def convert_complex_column_to_string (col : "pyarrow.Array" ) -> "pyarrow.Array" :
572
- python_values = col .to_pylist ()
573
- json_strings = [
574
- (None if val is None else json .dumps (val )) for val in python_values
575
- ]
576
- return pyarrow .array (json_strings , type = pyarrow .string ())
577
-
578
- converted_columns = []
579
- for col in rows .columns :
580
- converted_col = col
581
- if (
582
- pyarrow .types .is_list (col .type )
583
- or pyarrow .types .is_large_list (col .type )
584
- or pyarrow .types .is_struct (col .type )
585
- or pyarrow .types .is_map (col .type )
586
- ):
587
- converted_col = convert_complex_column_to_string (col )
588
- converted_columns .append (converted_col )
589
-
590
- return pyarrow .Table .from_arrays (converted_columns , names = rows .column_names )
591
-
592
555
def fetchmany_arrow (self , size : int ) -> "pyarrow.Table" :
593
556
"""
594
557
Fetch the next set of rows as an Arrow table.
@@ -609,9 +572,6 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
609
572
results = self .results .next_n_rows (size )
610
573
self ._next_row_index += results .num_rows
611
574
612
- if not self .backend ._use_arrow_native_complex_types :
613
- results = self ._convert_complex_types_to_string (results )
614
-
615
575
return results
616
576
617
577
def fetchall_arrow (self ) -> "pyarrow.Table" :
@@ -621,9 +581,6 @@ def fetchall_arrow(self) -> "pyarrow.Table":
621
581
results = self .results .remaining_rows ()
622
582
self ._next_row_index += results .num_rows
623
583
624
- if not self .backend ._use_arrow_native_complex_types :
625
- results = self ._convert_complex_types_to_string (results )
626
-
627
584
return results
628
585
629
586
def fetchone (self ) -> Optional [Row ]:
0 commit comments