Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fd = spark.createDataFrame([(['0143A'])], ['dt'])
- fd.show()
- +-----+
- | dt|
- +-----+
- |0143A|
- +-----+
- from pyspark.sql.functions import date_format, to_timestamp
- #fd.select(date_format('dt','hhmma')).show()
- fd.select(to_timestamp('dt','hhmmaa')).show()
- +----------------------------+
- |to_timestamp(`dt`, 'hhmmaa')|
- +----------------------------+
- | null|
- +----------------------------+
- Expected output: 01:43
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement