Skip to content

Commit c37234c

Browse files
author
gituser
committed
Merge branch '1.8_release_3.10.x_jingdongfang' into 1.8_release_3.10.x
2 parents 7047737 + b21485c commit c37234c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

flinkx-rdb/flinkx-rdb-reader/src/main/java/com.dtstack.flinkx.rdb.inputformat/JdbcInputFormat.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import java.sql.SQLException;
5454
import java.sql.Statement;
5555
import java.sql.Timestamp;
56+
import java.text.SimpleDateFormat;
5657
import java.util.ArrayList;
5758
import java.util.HashMap;
5859
import java.util.List;
@@ -129,6 +130,8 @@ public class JdbcInputFormat extends BaseRichInputFormat {
129130

130131
protected Row lastRow = null;
131132

133+
protected transient final static ThreadLocal<SimpleDateFormat> sdf = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmmss"));
134+
132135
protected String querySql;
133136

134137
/**
@@ -688,7 +691,12 @@ protected String getLocationSql(String incrementColType, String incrementCol, St
688691
} else if (ColumnType.isNumberType(incrementColType)) {
689692
endLocationSql = incrementCol + operator + location;
690693
} else {
691-
endTimeStr = String.format("'%s'", location);
694+
// FIXME 京东方特殊逻辑
695+
String part1 = location.substring(0, 13);
696+
String part2 = location.substring(13);
697+
String timeStr = sdf.get().format(new Date(Long.parseLong(part1))) + part2;
698+
699+
endTimeStr = String.format("'%s'",timeStr);
692700
endLocationSql = incrementCol + operator + endTimeStr;
693701
}
694702

0 commit comments

Comments
 (0)