This is an automated email from the ASF dual-hosted git repository.

sivabalan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ac2051ed09 [Hudi-6902] Fix the timestamp format in hive test (#10610)
0ac2051ed09 is described below

commit 0ac2051ed093ea9ab6d7244e0bd44482a287a9f7
Author: Lin Liu <141371752+linliu-c...@users.noreply.github.com>
AuthorDate: Fri Feb 2 20:37:41 2024 -0800

    [Hudi-6902] Fix the timestamp format in hive test (#10610)
---
 .../java/org/apache/hudi/hadoop/TestHoodieParquetInputFormat.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/hudi-hadoop-mr/src/test/java/org/apache/hudi/hadoop/TestHoodieParquetInputFormat.java
 
b/hudi-hadoop-mr/src/test/java/org/apache/hudi/hadoop/TestHoodieParquetInputFormat.java
index 37d625a599f..5bf0a255eb4 100644
--- 
a/hudi-hadoop-mr/src/test/java/org/apache/hudi/hadoop/TestHoodieParquetInputFormat.java
+++ 
b/hudi-hadoop-mr/src/test/java/org/apache/hudi/hadoop/TestHoodieParquetInputFormat.java
@@ -47,6 +47,7 @@ import org.apache.avro.generic.GenericData;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.ql.io.IOConstants;
+import org.apache.hadoop.hive.serde2.io.TimestampWritable;
 import org.apache.hadoop.io.ArrayWritable;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.NullWritable;
@@ -819,9 +820,9 @@ public class TestHoodieParquetInputFormat {
         } else {
           Date date = new Date();
           date.setTime(testTimestampLong);
-          assertEquals(
-              new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(date),
-              String.valueOf(writable.get()[0]));
+          Timestamp actualTime = ((TimestampWritable) 
writable.get()[0]).getTimestamp();
+          SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd 
HH:mm:ss.SSS");
+          assertEquals(dateFormat.format(date), dateFormat.format(actualTime));
         }
         // test long
         assertEquals(testTimestampLong * 1000, ((LongWritable) 
writable.get()[1]).get());

Reply via email to