@@ -600,43 +600,6 @@ def fetchall_json(self) -> List:
600
600
601
601
return results
602
602
603
- def _convert_complex_types_to_string (
604
- self , rows : "pyarrow.Table"
605
- ) -> "pyarrow.Table" :
606
- """
607
- Convert complex types (array, struct, map) to string representation.
608
-
609
- Args:
610
- rows: Input PyArrow table
611
-
612
- Returns:
613
- PyArrow table with complex types converted to strings
614
- """
615
-
616
- if not pyarrow :
617
- return rows
618
-
619
- def convert_complex_column_to_string (col : "pyarrow.Array" ) -> "pyarrow.Array" :
620
- python_values = col .to_pylist ()
621
- json_strings = [
622
- (None if val is None else json .dumps (val )) for val in python_values
623
- ]
624
- return pyarrow .array (json_strings , type = pyarrow .string ())
625
-
626
- converted_columns = []
627
- for col in rows .columns :
628
- converted_col = col
629
- if (
630
- pyarrow .types .is_list (col .type )
631
- or pyarrow .types .is_large_list (col .type )
632
- or pyarrow .types .is_struct (col .type )
633
- or pyarrow .types .is_map (col .type )
634
- ):
635
- converted_col = convert_complex_column_to_string (col )
636
- converted_columns .append (converted_col )
637
-
638
- return pyarrow .Table .from_arrays (converted_columns , names = rows .column_names )
639
-
640
603
def fetchmany_arrow (self , size : int ) -> "pyarrow.Table" :
641
604
"""
642
605
Fetch the next set of rows as an Arrow table.
@@ -662,9 +625,6 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
662
625
results = self ._convert_json_to_arrow (rows )
663
626
self ._next_row_index += results .num_rows
664
627
665
- if not self .backend ._use_arrow_native_complex_types :
666
- results = self ._convert_complex_types_to_string (results )
667
-
668
628
return results
669
629
670
630
def fetchall_arrow (self ) -> "pyarrow.Table" :
@@ -679,9 +639,6 @@ def fetchall_arrow(self) -> "pyarrow.Table":
679
639
results = self ._convert_json_to_arrow (rows )
680
640
self ._next_row_index += results .num_rows
681
641
682
- if not self .backend ._use_arrow_native_complex_types :
683
- results = self ._convert_complex_types_to_string (results )
684
-
685
642
return results
686
643
687
644
def fetchone (self ) -> Optional [Row ]:
0 commit comments