jackylk commented on a change in pull request #3598: [CARBONDATA-3684] Remove
MDK and cardinality in write path
URL: https://github.com/apache/carbondata/pull/3598#discussion_r377106994
##########
File path: core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java
##########
@@ -756,4 +756,45 @@ public static long toLongLittleEndian(byte[] bytes, int
offset) {
((long) bytes[offset + 3] & 0xff) << 24) | (((long) bytes[offset + 2]
& 0xff) << 16) | (
((long) bytes[offset + 1] & 0xff) << 8) | (((long) bytes[offset] &
0xff)));
}
+
+ public static byte[] convertDateToBytes(int date) {
+ return ByteUtil.toBytes(date);
+ }
+
+ public static byte[] convertDateToBytes(long[] date) {
+ byte[] output = new byte[date.length * 4];
+ for (int i = 0; i < date.length; i++) {
+ System.arraycopy(ByteUtil.toBytes(date[i]), 0, output, i * 4, 4);
+ }
+ return output;
+ }
+
+ public static int convertBytesToDate(byte[] date) {
+ return ByteUtil.toInt(date, 0);
+ }
+
+ public static int convertBytesToDate(byte[] date, int offset) {
+ return ByteUtil.toInt(date, offset);
+ }
+
+ public static int dateBytesSize() {
+ return 4;
+ }
+
+ public static int[] convertBytesToDateIntArray(byte[] input) {
Review comment:
fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services