Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gene-db committed Jan 7, 2025
1 parent 0086b34 commit 5af337f
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,7 @@ private static void appendQuoted(StringBuilder sb, String str) {
private static final DateTimeFormatter TIMESTAMP_NTZ_FORMATTER = new DateTimeFormatterBuilder()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral('T')
.appendValue(HOUR_OF_DAY, 2)
.appendLiteral(':')
.appendValue(MINUTE_OF_HOUR, 2)
.appendLiteral(':')
.appendValue(SECOND_OF_MINUTE, 2)
.appendPattern("HH:mm:ss")
.appendFraction(MICRO_OF_SECOND, 6, 6, true)
.toFormatter(Locale.US);

Expand All @@ -339,13 +335,10 @@ private static void appendQuoted(StringBuilder sb, String str) {
new DateTimeFormatterBuilder()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral('T')
.appendValue(HOUR_OF_DAY, 2)
.appendLiteral(':')
.appendValue(MINUTE_OF_HOUR, 2)
.appendLiteral(':')
.appendValue(SECOND_OF_MINUTE, 2)
.appendPattern("HH:mm:ss")
.optionalStart()
.appendFraction(MICRO_OF_SECOND, 0, 6, true)
.optionalEnd()
.toFormatter(Locale.US);

/** The format for a timestamp with time zone, truncating trailing microsecond zeros. */
Expand All @@ -354,8 +347,8 @@ private static void appendQuoted(StringBuilder sb, String str) {
.appendOffset("+HH:MM", "+00:00")
.toFormatter(Locale.US);

private static Instant microsToInstant(long timestamp) {
return Instant.EPOCH.plus(timestamp, ChronoUnit.MICROS);
private static Instant microsToInstant(long microsSinceEpoch) {
return Instant.EPOCH.plus(microsSinceEpoch, ChronoUnit.MICROS);
}

private static void toJsonImpl(byte[] value, byte[] metadata, int pos, StringBuilder sb,
Expand Down

0 comments on commit 5af337f

Please sign in to comment.