Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2490#discussion_r202705370
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedRowIdRawResultCollector.java
 ---
    @@ -0,0 +1,265 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.carbondata.core.scan.collector.impl;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import org.apache.carbondata.common.annotations.InterfaceAudience;
    +import org.apache.carbondata.core.constants.CarbonCommonConstants;
    +import org.apache.carbondata.core.datastore.block.SegmentProperties;
    +import org.apache.carbondata.core.keygenerator.KeyGenException;
    +import org.apache.carbondata.core.keygenerator.KeyGenerator;
    +import 
org.apache.carbondata.core.keygenerator.mdkey.MultiDimKeyVarLengthGenerator;
    +import org.apache.carbondata.core.metadata.datatype.DataTypes;
    +import org.apache.carbondata.core.metadata.encoder.Encoding;
    +import 
org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension;
    +import org.apache.carbondata.core.scan.executor.infos.BlockExecutionInfo;
    +import org.apache.carbondata.core.scan.model.ProjectionDimension;
    +import org.apache.carbondata.core.scan.model.ProjectionMeasure;
    +import org.apache.carbondata.core.scan.result.BlockletScannedResult;
    +import org.apache.carbondata.core.scan.wrappers.ByteArrayWrapper;
    +import org.apache.carbondata.core.stats.QueryStatistic;
    +import org.apache.carbondata.core.stats.QueryStatisticsConstants;
    +import org.apache.carbondata.core.util.CarbonUtil;
    +import org.apache.carbondata.core.util.DataTypeUtil;
    +
    +import org.apache.commons.lang3.ArrayUtils;
    +
    +/**
    + * It is not a collector it is just a scanned result holder.
    + * most of the lines are copyied from 
`RestructureBasedRawResultCollector`, the difference in
    + * function is that this class return all the dimensions in a 
ByteArrayWrapper and append
    + * blockletNo/PageId/RowId at end of the row.
    + * This implementation refers to `RestructureBasedRawResultCollector`
    + */
    +@InterfaceAudience.Internal
    +public class RestructureBasedRowIdRawResultCollector extends 
RowIdRawBasedResultCollector {
    --- End diff --
    
    There are many duplicated code from `RestructureBasedRawResultCollector`, 
it is not good for maintenance. Can you optimize it. 


---

Reply via email to