jackylk commented on a change in pull request #3638: [CARBONDATA-3731] Avoid 
data copy in Writer
URL: https://github.com/apache/carbondata/pull/3638#discussion_r387470422
 
 

 ##########
 File path: 
core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java
 ##########
 @@ -182,20 +190,18 @@ public static ColumnPage newPage(ColumnPageEncoderMeta 
columnPageEncoderMeta, in
           dataType == LONG ||
           dataType == DataTypes.FLOAT ||
           dataType == DataTypes.DOUBLE) {
-        instance = new UnsafeFixLengthColumnPage(
-            new ColumnPageEncoderMeta(columnSpec, dataType, compressorName), 
pageSize);
+        instance = new UnsafeFixLengthColumnPage(columnPageEncoderMeta, 
pageSize);
       } else if (dataType == DataTypes.TIMESTAMP) {
         instance = new UnsafeFixLengthColumnPage(
             new ColumnPageEncoderMeta(columnSpec, LONG, compressorName), 
pageSize);
       } else if (DataTypes.isDecimal(dataType)) {
-        instance = new UnsafeDecimalColumnPage(
-            new ColumnPageEncoderMeta(columnSpec, dataType, compressorName), 
pageSize);
-      } else if (dataType == DataTypes.STRING
-          || dataType == BYTE_ARRAY
-          || dataType == DataTypes.VARCHAR
-          || dataType == DataTypes.BINARY) {
-        instance = new UnsafeVarLengthColumnPage(
-            new ColumnPageEncoderMeta(columnSpec, dataType, compressorName), 
pageSize);
+        instance = new UnsafeDecimalColumnPage(columnPageEncoderMeta, 
pageSize);
+      } else if (dataType == DataTypes.STRING ||
+          dataType == DataTypes.VARCHAR ||
+          dataType == DataTypes.BINARY) {
+        instance = new ByteBufferColumnPage(columnPageEncoderMeta, pageSize);
+      } else if (dataType == BYTE_ARRAY) {
+        instance = new UnsafeVarLengthColumnPage(columnPageEncoderMeta, 
pageSize);
 
 Review comment:
   It is not always for LV flow, for example, for local dictionary it uses 
UnsafeFixLengthColumnPage with store data type as BYTE_ARRAY

----------------------------------------------------------------
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

Reply via email to