pgaref commented on a change in pull request #2009:
URL: https://github.com/apache/hive/pull/2009#discussion_r585545605
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/CastTimestampToString.java
##########
@@ -28,20 +28,12 @@
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
-import java.time.temporal.ChronoField;
public class CastTimestampToString extends TimestampToStringUnaryUDF {
private static final long serialVersionUID = 1L;
- private static final DateTimeFormatter PRINT_FORMATTER;
-
- static {
- DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
- // Date and time parts
- builder.append(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
- // Fractional part
- builder.optionalStart().appendFraction(ChronoField.NANO_OF_SECOND, 0, 9,
true).optionalEnd();
- PRINT_FORMATTER = builder.toFormatter();
- }
+ private static final DateTimeFormatter PRINT_FORMATTER =
+ new
DateTimeFormatterBuilder().append(DateTimeFormatter.ISO_LOCAL_DATE).appendLiteral('
')
+ .append(DateTimeFormatter.ISO_LOCAL_TIME).toFormatter();
Review comment:
is optional Nanotime included in ISO_LOCAL_TIME ?
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]