@@ -736,8 +736,9 @@ def parse_column_name(column)
736736 [ split [ 0 ] , split . length > 1 ? split [ 1 ] : nil ]
737737 end
738738
739- def toISO8601 ( millis )
740- return java . time . Instant . ofEpochMilli ( millis ) . toString
739+ def toLocalDateTime ( millis )
740+ instant = java . time . Instant . ofEpochMilli ( millis )
741+ return java . time . LocalDateTime . ofInstant ( instant , java . time . ZoneId . systemDefault ( ) ) . toString
741742 end
742743
743744 # Make a String of the passed kv
@@ -748,7 +749,7 @@ def to_string(column, kv, maxlength = -1, converter_class = nil, converter = nil
748749 column . start_with? ( 'info:merge' )
749750 hri = org . apache . hadoop . hbase . HRegionInfo . parseFromOrNull ( kv . getValueArray ,
750751 kv . getValueOffset , kv . getValueLength )
751- return format ( 'timestamp=%s, value=%s' , toISO8601 ( kv . getTimestamp ) ,
752+ return format ( 'timestamp=%s, value=%s' , toLocalDateTime ( kv . getTimestamp ) ,
752753 hri . nil? ? '' : hri . toString )
753754 end
754755 if column == 'info:serverstartcode'
@@ -759,14 +760,14 @@ def to_string(column, kv, maxlength = -1, converter_class = nil, converter = nil
759760 str_val = org . apache . hadoop . hbase . util . Bytes . toStringBinary ( kv . getValueArray ,
760761 kv . getValueOffset , kv . getValueLength )
761762 end
762- return format ( 'timestamp=%s, value=%s' , toISO8601 ( kv . getTimestamp ) , str_val )
763+ return format ( 'timestamp=%s, value=%s' , toLocalDateTime ( kv . getTimestamp ) , str_val )
763764 end
764765 end
765766
766767 if org . apache . hadoop . hbase . CellUtil . isDelete ( kv )
767- val = "timestamp=#{ toISO8601 ( kv . getTimestamp ) } , type=#{ org . apache . hadoop . hbase . KeyValue ::Type . codeToType ( kv . getTypeByte ) } "
768+ val = "timestamp=#{ toLocalDateTime ( kv . getTimestamp ) } , type=#{ org . apache . hadoop . hbase . KeyValue ::Type . codeToType ( kv . getTypeByte ) } "
768769 else
769- val = "timestamp=#{ toISO8601 ( kv . getTimestamp ) } , value=#{ convert ( column , kv , converter_class , converter ) } "
770+ val = "timestamp=#{ toLocalDateTime ( kv . getTimestamp ) } , value=#{ convert ( column , kv , converter_class , converter ) } "
770771 end
771772 maxlength != -1 ? val [ 0 , maxlength ] : val
772773 end
0 commit comments