zhengruifeng commented on PR #51585:
URL: https://github.com/apache/spark/pull/51585#issuecomment-3277220030

   @uros-db @MaxGekk 
   
   ```
   In [2]:     >>> import pyspark.sql.functions as sf
      ...:     >>> df = spark.createDataFrame([("10:30:00", "HH:mm:ss")], 
["str", "format"])
      ...:     >>> df.select(sf.try_to_time(df.str, df.format)).show()
   +---------------------------------+
   |try_to_time(to_time(str, format))|
   +---------------------------------+
   |                         10:30:00|
   +---------------------------------+
   ```
   
   it seems the default column name `try_to_time(to_time(xxx, xxx))` is not 
consistent with other similar functions, like:
   ```
   In [1]:     >>> import pyspark.sql.functions as sf
      ...:     >>> df = spark.createDataFrame([('1997-02-28 10:30:00',)], ['t'])
      ...:     >>> df.select(sf.try_to_timestamp(df.t, sf.lit('yyyy-MM-dd 
HH:mm:ss'))).show()
   +----------------------------------------+
   |try_to_timestamp(t, yyyy-MM-dd HH:mm:ss)|
   +----------------------------------------+
   |                     1997-02-28 10:30:00|
   +----------------------------------------+
   ```
   
   is this expected?


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