Skip to content

Commit

Permalink
#30 inline dateTime methods
Browse files Browse the repository at this point in the history
  • Loading branch information
doom369 committed Sep 6, 2019
1 parent 2e355dc commit 2aaaf40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,21 @@ public static String formatBoolean(boolean myBoolean) {
}

public static String formatDate(Date date, TimeZone timeZone) {
getDateFormat().setTimeZone(timeZone);
return getDateFormat().format(date);
SimpleDateFormat simpleDateFormat = dateFormat.get();
simpleDateFormat.setTimeZone(timeZone);
return simpleDateFormat.format(date);
}

public static String formatTime(Time time, TimeZone timeZone) {
getDateTimeFormat().setTimeZone(timeZone);
return getDateTimeFormat().format(time);
SimpleDateFormat simpleDateFormat = dateTimeFormat.get();
simpleDateFormat.setTimeZone(timeZone);
return simpleDateFormat.format(time);
}

public static String formatTimestamp(Timestamp time, TimeZone timeZone) {
getDateTimeFormat().setTimeZone(timeZone);
return getDateTimeFormat().format(time);
SimpleDateFormat simpleDateFormat = dateTimeFormat.get();
simpleDateFormat.setTimeZone(timeZone);
return simpleDateFormat.format(time);
}

private static String formatUUID(UUID x) {
Expand Down Expand Up @@ -168,13 +171,5 @@ public static boolean needsQuoting(Object o) {
return true;
}

private static SimpleDateFormat getDateFormat() {
return dateFormat.get();
}

private static SimpleDateFormat getDateTimeFormat() {
return dateTimeFormat.get();
}

private ClickHouseValueFormatter() { /* NOP */ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class ClickHousePreparedStatementRealTablesTest {

private static int RECORDS = 3_000_000;
private static int RECORDS = 10_000_000;
private ClickHouseDataSource dataSource;
private Connection connection;

Expand Down

0 comments on commit 2aaaf40

Please sign in to comment.