cloud-fan commented on code in PR #39925:
URL: https://github.com/apache/spark/pull/39925#discussion_r1102371321


##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -1280,10 +1280,20 @@ def __getitem__(self, item: Union[int, str, Column, 
List, Tuple]) -> Union[Colum
         if isinstance(item, str):
             # Check for alias
             alias = self._get_alias()
-            if alias is not None:
-                return col(alias)
+            _col = alias if alias is not None else item
+            if _col == "*":
+                return Column(UnresolvedStar(unparsed_target=None))
+            elif _col.endswith(".*"):
+                return Column(UnresolvedStar(unparsed_target=_col))
             else:
-                return col(item)
+                if self._plan is None:
+                    raise Exception("Cannot analyze on empty plan.")
+                return Column(
+                    ColumnReference(

Review Comment:
   like having a private version of `def col` which takes an extra plan id.



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