I am trying to convert a string (UTC time) to timestamp.
List<String> list = new ArrayList<String>();
list.add("2018-03-11 02:00:00");
list.add("2018-03-11 03:00:00");
sparkSession.createDataset(list, Encoders.STRING()).select(to_timestamp(col("value").cast(DataTypes.TimestampType), "yyyy-MM-dd HH:mm:ss")).show();
The output for this is
+-------------------+
| value|
+-------------------+
|2018-03-11 03:00:00|
|2018-03-11 03:00:00|
+-------------------+
I can see that its applying the DST (CST), which should not be applied in my case as I am dealing with UTC string.
Any ideas?