Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
Update utils.renderDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyHuo committed Mar 21, 2018
1 parent bbdff01 commit c779964
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/com/sina/bip/hangout/outputs/ClickhouseUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ public static String renderDefault(String dataType) {
else if (dataType.equals("Date")) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
return String.format("'%s'", dateFormat.format(new Date()));
}
else if (dataType.equals("DataTime")) {
} else if (dataType.equals("DataTime")) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return String.format("'%s'", dateFormat.format(new Date()));
} else
} else if (dataType.startsWith("Float")) {
return "0.0";
} else if (dataType.startsWith("UInt") || dataType.startsWith("Int")) {
return "0";
} else {
return "";
}
}

public static String realField(String field) {
Expand Down

0 comments on commit c779964

Please sign in to comment.