grundprinzip commented on code in PR #38908:
URL: https://github.com/apache/spark/pull/38908#discussion_r1039339231


##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -137,7 +137,13 @@ def isEmpty(self) -> bool:
         return len(self.take(1)) == 0
 
     def select(self, *cols: "ColumnOrName") -> "DataFrame":
-        return DataFrame.withPlan(plan.Project(self._plan, *cols), 
session=self._session)
+        sql_expr = []
+        for element in cols:
+            if isinstance(element, str):
+                sql_expr.append(sql_expression(element))

Review Comment:
   Unfortunately that does not work either:
   
   ```
   
s2.read.table("martin.trips").groupBy("martin.trips.pickup_zip").sum("fare_amount").select("sum(fare_amount)").show()
   ```
   
   Now the `sum()` is working but `martin.trips.pickup_zip` becomes a quoted 
identifier as well.
   
   ```
        details = "[UNRESOLVED_COLUMN.WITH_SUGGESTION] A column or function 
parameter with name `martin.trips.pickup_zip` cannot be resolved. Did you mean 
one of the following? [`spark_catalog`.`martin`.`trips`.`pickup_zip`, 
`spark_catalog`.`martin`.`trips`.`fare_amount`];
   'Project [unresolvedalias('sum(fare_amount), None)]
   +- 'Aggregate ['`martin.trips.pickup_zip`], ['`martin.trips.pickup_zip`, 
sum(fare_amount#19) AS sum(fare_amount)#60]
      +- SubqueryAlias spark_catalog.martin.trips
         +- Relation spark_catalog.martin.trips[pickup_zip#18,fare_amount#19] 
parquet
   "
   ```
   



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to