[ https://issues.apache.org/jira/browse/CARBONDATA-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15591361#comment-15591361 ] ASF GitHub Bot commented on CARBONDATA-301: ------------------------------------------- Github user jackylk commented on a diff in the pull request: https://github.com/apache/incubator-carbondata/pull/247#discussion_r84245645 --- Diff: processing/src/main/java/org/apache/carbondata/processing/newflow/steps/sort/SortProcessorStepImpl.java --- @@ -0,0 +1,237 @@ +/* + * 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.processing.newflow.steps.sort; + +import java.io.File; +import java.util.Iterator; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +import org.apache.carbondata.common.CarbonIterator; +import org.apache.carbondata.common.logging.LogService; +import org.apache.carbondata.common.logging.LogServiceFactory; +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.util.CarbonTimeStatisticsFactory; +import org.apache.carbondata.processing.newflow.AbstractDataLoadProcessorStep; +import org.apache.carbondata.processing.newflow.CarbonDataLoadConfiguration; +import org.apache.carbondata.processing.newflow.DataField; +import org.apache.carbondata.processing.newflow.constants.DataLoadProcessorConstants; +import org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException; +import org.apache.carbondata.processing.newflow.row.CarbonRow; +import org.apache.carbondata.processing.newflow.row.CarbonRowBatch; +import org.apache.carbondata.processing.sortandgroupby.exception.CarbonSortKeyAndGroupByException; +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortDataRows; +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortIntermediateFileMerger; +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters; +import org.apache.carbondata.processing.store.SingleThreadFinalSortFilesMerger; +import org.apache.carbondata.processing.store.writer.exception.CarbonDataWriterException; +import org.apache.carbondata.processing.util.CarbonDataProcessorUtil; + +/** + * It sorts the data and write them to intermediate temp files. These files will be further read + * by next step for writing to carbondata files. + */ +public class SortProcessorStepImpl extends AbstractDataLoadProcessorStep { --- End diff -- In this step, better to abstract an interface called `Sorter`. We can move current sort implementation (SortDataRows/SortIntermediateFileMerger) into `MergeSortSorter` which implements `Sorter`, and we can add `ExternalSorter` later for in memory sort So in this class, there will be an member variable called sorter. Or, we can create another PR to do it if hard to do in one PR > 6. Add SortProcessorStep which sorts the data as per dimension order and write the sorted files to temp location. > ----------------------------------------------------------------------------------------------------------------- > > Key: CARBONDATA-301 > URL: https://issues.apache.org/jira/browse/CARBONDATA-301 > Project: CarbonData > Issue Type: Sub-task > Reporter: Ravindra Pesala > Fix For: 0.2.0-incubating > > > Add SortProcessorStep which sorts the data as per dimension order and write the sorted files to temp location. -- This message was sent by Atlassian JIRA (v6.3.4#6332) |
Free forum by Nabble | Edit this page |