jackylk commented on a change in pull request #3389: [CARBONDATA-3524] Support global_sort compaction
URL: https://github.com/apache/carbondata/pull/3389#discussion_r329313515 ########## File path: integration/spark-common/src/main/scala/org/apache/carbondata/spark/SegmentUtils.scala ########## @@ -0,0 +1,101 @@ +/* + * 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.spark + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.mapred.JobConf +import org.apache.hadoop.mapreduce.{InputSplit, Job} +import org.apache.spark.deploy.SparkHadoopUtil +import org.apache.spark.rdd.RDD +import org.apache.spark.sql.catalyst.expressions.GenericRow +import org.apache.spark.sql.util.{SparkSQLUtil, SparkTypeConverter} +import org.apache.spark.CarbonInputMetrics +import org.apache.spark.sql.{DataFrame, Row, SparkSession} + +import org.apache.carbondata.core.datamap.Segment +import org.apache.carbondata.core.datastore.row.CarbonRow +import org.apache.carbondata.core.metadata.datatype.{StructField, StructType} +import org.apache.carbondata.core.metadata.schema.table.CarbonTable +import org.apache.carbondata.hadoop.CarbonProjection +import org.apache.carbondata.hadoop.api.{CarbonInputFormat, CarbonTableInputFormat, + CarbonTableOutputFormat} +import org.apache.carbondata.processing.loading.constants.DataLoadProcessorConstants +import org.apache.carbondata.processing.loading.model.CarbonLoadModel +import org.apache.carbondata.processing.util.TableOptionConstant +import org.apache.carbondata.spark.rdd.CarbonScanRDD +import org.apache.carbondata.store.CarbonRowReadSupport + +/** + * utils of segment + */ +object SegmentUtils { + + /** + * get splits of specified segments + */ + def splitsOfSegments( Review comment: I think it is better to put this func to `CarbonTableInputFormat`, it is a func to get the split from a list of segments ---------------------------------------------------------------- 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: [hidden email] With regards, Apache Git Services |
Free forum by Nabble | Edit this page |