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


##########
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:
   ~~got it~~
   
   A column can also be a struct containing duplicated names, but is not 
introduced by this PR since nested types are not supported yet



-- 
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