ajantha-bhat commented on a change in pull request #3638: [CARBONDATA-3731]
Avoid data copy in Writer
URL: https://github.com/apache/carbondata/pull/3638#discussion_r387467864
##########
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:
This is also LV flow, I think we can use `ByteBufferColumnPage` for
BYTE_ARRAY also
----------------------------------------------------------------
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