Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2654#discussion_r214038515
--- Diff:
core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java ---
@@ -976,4 +978,122 @@ public static long
getDataBasedOnRestructuredDataType(byte[] data, DataType rest
return value;
}
+ /**
+ * Check if the column is a no dictionary primitive column
+ *
+ * @param dataType
+ * @return
+ */
+ public static boolean isPrimitiveColumn(DataType dataType) {
+ if (dataType == DataTypes.BOOLEAN || dataType == DataTypes.BYTE ||
dataType == DataTypes.SHORT
+ || dataType == DataTypes.INT || dataType == DataTypes.LONG ||
DataTypes.isDecimal(dataType)
+ || dataType == DataTypes.FLOAT || dataType == DataTypes.DOUBLE
+ || dataType == DataTypes.BYTE_ARRAY) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Put the data to unsafe memory
+ *
+ * @param dataType
+ * @param data
+ * @param baseObject
+ * @param address
+ * @param size
+ * @param sizeInBytes
+ */
+ public static void putDataToUnsafe(DataType dataType, Object data,
Object baseObject,
--- End diff --
Create a new class CarbonUnsafeUtil and move this method there
---