From 37c5168a7dc2199d3eb2530294d2bd2894d76d75 Mon Sep 17 00:00:00 2001 From: mcy Date: Fri, 22 Mar 2019 14:49:50 +0800 Subject: [PATCH] code optimization --- .../canal/client/adapter/hbase/support/PhTypeUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/support/PhTypeUtil.java b/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/support/PhTypeUtil.java index fc0cc909..f3d38057 100644 --- a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/support/PhTypeUtil.java +++ b/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/support/PhTypeUtil.java @@ -130,8 +130,10 @@ public class PhTypeUtil { } else if (b[0] == 0) { v = false; } - } else if (phType == PhType.TIME || phType == PhType.DATE) { - v = new Date(decodeLong(b, 0)); + } else if (phType == PhType.DATE) { + v = new java.sql.Date(decodeLong(b, 0)); + } else if (phType == PhType.TIME) { + v = new java.sql.Time(decodeLong(b, 0)); } else if (phType == PhType.TIMESTAMP) { long millisDeserialized = decodeLong(b, 0); Timestamp ts = new Timestamp(millisDeserialized);