Description
For example:
scala> val t = java.sql.Timestamp.valueOf("2019-11-18 11:56:00.123456") t: java.sql.Timestamp = 2019-11-18 11:56:00.123456 scala> Seq(t).toDF("t").select(to_json(struct($"t"), Map("timestampFormat" -> "yyyy-MM-dd HH:mm:ss.SSSSSS"))).show(false) +-------------------------------------------------+ |structstojson(named_struct(NamePlaceholder(), t))| +-------------------------------------------------+ |{"t":"2019-11-18 11:56:00.000123"} | +-------------------------------------------------+
Attachments
Issue Links
- links to