dougbateman commented on a change in pull request #25489: [PYTHON][WIP] 
pyspark.sql.functions.col as C
URL: https://github.com/apache/spark/pull/25489#discussion_r315905300
 
 

 ##########
 File path: python/pyspark/sql/functions.py
 ##########
 @@ -315,6 +312,46 @@ def _options_to_str(options):
 del _name, _doc
 
 
+class column_function(object):
+    """
+    Returns a :class:`Column` based on the given column name.
+
+    >>> __name__("firstName")
+    Column<firstName>
+
+    >>> __name__["firstName"]
+    Column<firstName>
+
+    >>> __name__.firstName
 
 Review comment:
   df.column_name is verbose if the DF has a meaningful name like customersDF:
   customersDF.select(customersDF.firstName, customersDF.lastName, 
customersDF.zip)
   
   The idea here is to get something as concise as the scala $.
   customersDF.select(C.firstName, C.lastName, C.zip)
   
   For whitespace, we'd need to use the full version:
   customersDF.select(C("First Name"), C("Last Name), C("Zip"))
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to