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

Commit

Permalink
Merge branch 'rickyhuo.fix.date'
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyHuo committed Jan 11, 2019
2 parents b2fbd6b + 6e69f92 commit ef62932
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

* Author: rickyHuo
* Homepage: https://github.com/RickyHuo/hangout-output-clickhouse
* Version: 0.0.7
* Version: 0.0.8

### Description

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>sina</groupId>
<artifactId>hangout-output-plugins-clickhouse</artifactId>
<version>0.0.7</version>
<version>0.0.8</version>
<packaging>jar</packaging>

<name>hangout-output-plugins-clickhouse</name>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/sina/bip/hangout/outputs/Clickhouse.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ private void eventInsert(Map event, int eventSize) throws Exception {

// 重试3次
if (this.events.size() >= eventSize + 3) {
this.events.clear();
log.error("Retry 3 times failed, drop this bulk, number: " + this.bulkNum);
this.bulkNum += 1;
log.error("Retry failed 3 times, system exit");
System.exit(1);
}
if (this.events.size() >= eventSize) {

Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/sina/bip/hangout/outputs/TabSeparated.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ public void bulkInsert(List<Map> events) throws Exception {
break;
case "DateTime":
if (fieldValue != null) {
statement.setString(i + 1, fieldValue.toString());
if (fieldValue.equals(0) || fieldValue.equals("0")) {
statement.setString(i + 1, "0000-00-00 00:00:00");
} else {
statement.setString(i + 1, fieldValue.toString());
}
} else {
statement.setString(i + 1, this.datetimeFormat.format(System.currentTimeMillis()));
}
Expand Down

0 comments on commit ef62932

Please sign in to comment.