zhengruifeng commented on code in PR #39461:
URL: https://github.com/apache/spark/pull/39461#discussion_r1064359982


##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -1147,18 +1147,28 @@ def collect(self) -> List[Row]:
         table = self._session.client.to_table(query)
 
         rows: List[Row] = []
-        for row in table.to_pylist():
-            _dict: Dict[Any, Any] = {}
-            for k, v in row.items():
+        i = 0
+        while i < table.num_rows:
+            keys: List[Any] = []
+            values: List[Any] = []
+            j = 0
+            while j < table.num_columns:
+                k = table.column_names[j]
+                v = table.column(j).to_pylist()[i]

Review Comment:
   ~~is it possible that `table.column(j).to_pylist()` also have this issue?~~
   
   ~~`table.column(j)` could also be a struct type~~
   
   ignore this comment, nested datatype had not been supported so far.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to