File tree 1 file changed +8
-5
lines changed 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 22
22
ParamEscaper ,
23
23
inject_parameters ,
24
24
transform_paramstyle ,
25
+ ArrowQueue ,
26
+ ColumnQueue
25
27
)
26
28
from databricks .sql .parameters .native import (
27
29
DbsqlParameterBase ,
@@ -1135,11 +1137,11 @@ def _fill_results_buffer(self):
1135
1137
def _convert_columnar_table (self , table ):
1136
1138
column_names = [c [0 ] for c in self .description ]
1137
1139
ResultRow = Row (* column_names )
1138
-
1140
+ print ( "Table \n " , table )
1139
1141
result = []
1140
1142
for row_index in range (len (table [0 ])):
1141
1143
curr_row = []
1142
- for col_index in range (len (table )- 1 , - 1 , - 1 ):
1144
+ for col_index in range (len (table )):
1143
1145
curr_row .append (table [col_index ][row_index ])
1144
1146
result .append (ResultRow (* curr_row ))
1145
1147
@@ -1246,10 +1248,11 @@ def fetchall(self) -> List[Row]:
1246
1248
"""
1247
1249
Fetch all (remaining) rows of a query result, returning them as a list of rows.
1248
1250
"""
1251
+ if isinstance (self .results , ColumnQueue ):
1252
+ return self ._convert_columnar_table (self .fetchall_columnar ())
1253
+ else :
1254
+ return self ._convert_arrow_table (self .fetchall_arrow ())
1249
1255
1250
- return self ._convert_columnar_table (self .fetchall_columnar ())
1251
-
1252
- return self ._convert_arrow_table (self .fetchall_arrow ())
1253
1256
1254
1257
def fetchmany (self , size : int ) -> List [Row ]:
1255
1258
"""
You can’t perform that action at this time.
0 commit comments