You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by watermen <gi...@git.apache.org> on 2017/05/12 08:10:19 UTC

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

GitHub user watermen opened a pull request:

    https://github.com/apache/carbondata/pull/910

    [WIP] Global sort by spark in load process

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/watermen/incubator-carbondata load

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/910.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #910
    
----
commit 0c541a3ab425f60cd3d3f45a2389f3c311d89568
Author: Yadong Qi <qi...@gmail.com>
Date:   2017-05-12T06:54:20Z

    Global sort by spark in load process.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121300326
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSort.scala ---
    @@ -0,0 +1,152 @@
    +/*
    + * 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.load
    +
    +import java.util.Comparator
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.constants.CarbonCommonConstants
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.statusmanager.LoadMetadataDetails
    +import org.apache.carbondata.processing.csvload.{CSVInputFormat, StringArrayWritable}
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.{NewRowComparator, NewRowComparatorForNormalDims, SortParameters}
    +import org.apache.carbondata.processing.util.CarbonDataProcessorUtil
    +import org.apache.carbondata.spark.util.CommonUtil
    +import org.apache.hadoop.conf.Configuration
    +import org.apache.hadoop.io.NullWritable
    +import org.apache.hadoop.mapreduce.lib.input.FileInputFormat
    +import org.apache.spark.{SparkContext, TaskContext}
    +import org.apache.spark.rdd.NewHadoopRDD
    +import org.apache.spark.sql.DataFrame
    +import org.apache.spark.sql.execution.command.ExecutionErrors
    +import org.apache.spark.storage.StorageLevel
    +
    +/**
    +  * Use sortBy operator in spark to load the data
    +  */
    +object GlobalSort {
    --- End diff --
    
    Name it similar to `DataLoadProcessBuilder`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2007/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/294/<h2>Build result: FAILURE</span></h2>[...truncated 65.64 KB...][ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :carbondata-spark-common[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkin
 s-slave/workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbondata-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/works
 pace/carbondata-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pom[JENKINS] Archiving 
 /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomchannel stoppedSetting status of 763d586c806579d5df482639b357914d247faf75 to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/294/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2022/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/268/<h2>Build result: FAILURE</span></h2>[...truncated 66.46 KB...][ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :carbondata-spark-common[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pomNo artifacts from carbondata-pr-spark-1.6 » Apache CarbonData :: Spark Common #266 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbonda
 ta-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pomNo artifacts from carbondata-pr-spark-1.6 » Apache CarbonData :: Assembly #266 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbon
 data-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pomNo artifacts from carbondata-pr
 -spark-1.6 » Apache CarbonData :: Spark Common Test #266 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomNo artifacts from carbondata-pr-spark-1.6 » Apache CarbonData :: Spark #266 to compare, so performing full copy of artifactschannel stoppedSetting status of b8e98247689947e1f9133dad916cd7587d74ad8c to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/268/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2404/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/217/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121302968
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSortOperates.scala ---
    @@ -0,0 +1,242 @@
    +/*
    + * 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.load
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.datastore.exception.CarbonDataWriterException
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.util.CarbonProperties
    +import org.apache.carbondata.processing.csvload.StringArrayWritable
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.newflow.converter.impl.RowConverterImpl
    +import org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException
    +import org.apache.carbondata.processing.newflow.parser.impl.RowParserImpl
    +import org.apache.carbondata.processing.newflow.sort.SortHelper
    +import org.apache.carbondata.processing.newflow.steps.{DataConverterProcessorStepImpl, DataWriterProcessorStepImpl}
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters
    +import org.apache.carbondata.processing.store.{CarbonFactHandler, CarbonFactHandlerFactory}
    +import org.apache.carbondata.spark.rdd.{NewRddIterator, StringArrayRow}
    +import org.apache.spark.broadcast.Broadcast
    +import org.apache.spark.sql.Row
    +import org.apache.spark.util.LongAccumulator
    +import org.apache.spark.{SparkEnv, TaskContext}
    +
    +import scala.util.Random
    +
    +object GlobalSortOperates {
    +  private val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +
    +  def toStringArrayRow(row: StringArrayWritable, columnCount: Int): StringArrayRow = {
    +    val outRow = new StringArrayRow(new Array[String](columnCount))
    +    outRow.setValues(row.get())
    +  }
    +
    +  def toRDDIterator(
    +      rows: Iterator[Row],
    +      modelBroadcast: Broadcast[CarbonLoadModel]): Iterator[Array[AnyRef]] = {
    +    new Iterator[Array[AnyRef]] {
    +      val iter = new NewRddIterator(rows, modelBroadcast.value, TaskContext.get())
    +
    +      override def hasNext: Boolean = iter.hasNext
    +
    +      override def next(): Array[AnyRef] = iter.next
    +    }
    +  }
    +
    +  def inputFunc(
    +      rows: Iterator[Array[AnyRef]],
    +      index: Int,
    +      currentLoadCount: Int,
    +      modelBroadcast: Broadcast[CarbonLoadModel],
    +      rowNumber: LongAccumulator): Iterator[CarbonRow] = {
    +    val model: CarbonLoadModel = getModelCopy(index, currentLoadCount, modelBroadcast)
    +    val conf = DataLoadProcessBuilder.createConfiguration(model)
    +    val rowParser = new RowParserImpl(conf.getDataFields, conf)
    +
    +    TaskContext.get().addTaskFailureListener { (t: TaskContext, e: Throwable) =>
    +      wrapException(e, model)
    +    }
    +
    +    new Iterator[CarbonRow] {
    +      override def hasNext: Boolean = rows.hasNext
    +
    +      override def next(): CarbonRow = {
    +        rowNumber.add(1)
    +        new CarbonRow(rowParser.parseRow(rows.next()))
    +      }
    +    }
    +  }
    +
    +  def convertFunc(
    +      rows: Iterator[CarbonRow],
    +      index: Int,
    +      currentLoadCount: Int,
    +      modelBroadcast: Broadcast[CarbonLoadModel],
    +      partialSuccessAccum: LongAccumulator,
    +      rowNumber: LongAccumulator): Iterator[CarbonRow] = {
    +    val model: CarbonLoadModel = getModelCopy(index, currentLoadCount, modelBroadcast)
    +    val conf = DataLoadProcessBuilder.createConfiguration(model)
    +    val badRecordLogger = DataConverterProcessorStepImpl.createBadRecordLogger(conf)
    +    val rowConverter = new RowConverterImpl(conf.getDataFields, conf, badRecordLogger)
    +    rowConverter.initialize()
    +
    +    TaskContext.get().addTaskCompletionListener { context =>
    +      DataConverterProcessorStepImpl.close(badRecordLogger, conf, rowConverter)
    +      GlobalSortHelper.badRecordsLogger(model, partialSuccessAccum)
    +    }
    +
    +    TaskContext.get().addTaskFailureListener { (t: TaskContext, e: Throwable) =>
    +      DataConverterProcessorStepImpl.close(badRecordLogger, conf, rowConverter)
    +      GlobalSortHelper.badRecordsLogger(model, partialSuccessAccum)
    +
    +      wrapException(e, model)
    +    }
    +
    +    new Iterator[CarbonRow] {
    +      override def hasNext: Boolean = rows.hasNext
    +
    +      override def next(): CarbonRow = {
    +        rowNumber.add(1)
    +        rowConverter.convert(rows.next())
    +      }
    +    }
    +  }
    +
    +  def convertTo3Parts(
    +      rows: Iterator[CarbonRow],
    +      index: Int,
    +      currentLoadCount: Int,
    +      modelBroadcast: Broadcast[CarbonLoadModel],
    +      rowNumber: LongAccumulator): Iterator[CarbonRow] = {
    +    val model: CarbonLoadModel = getModelCopy(index, currentLoadCount, modelBroadcast)
    +    val conf = DataLoadProcessBuilder.createConfiguration(model)
    +    val sortParameters = SortParameters.createSortParameters(conf)
    +    val sortHelper = new SortHelper(sortParameters)
    +
    +    TaskContext.get().addTaskFailureListener { (t: TaskContext, e: Throwable) =>
    +      wrapException(e, model)
    +    }
    +
    +    new Iterator[CarbonRow] {
    +      override def hasNext: Boolean = rows.hasNext
    +
    +      override def next(): CarbonRow = {
    +        rowNumber.add(1)
    +        new CarbonRow(sortHelper.convertRow(rows.next().getData))
    +      }
    +    }
    +  }
    +
    +  def writeFunc(
    +      rows: Iterator[CarbonRow],
    +      index: Int,
    +      currentLoadCount: Int,
    +      modelBroadcast: Broadcast[CarbonLoadModel],
    +      rowNumber: LongAccumulator) {
    +    var model: CarbonLoadModel = null
    +    var tableName: String = null
    +    var rowConverter: RowConverterImpl = null
    +
    +    try {
    +      model = getModelCopy(index, currentLoadCount, modelBroadcast)
    +      val storeLocation = getTempStoreLocation(index)
    +      val conf = DataLoadProcessBuilder.createConfiguration(model, storeLocation)
    +
    +      tableName = model.getTableName
    +
    +      // When we use sortBy, it means we have 2 stages. Stage1 can't get the finder from Stage2 directly because they
    +      // are in different processes. We need to set cardinality finder in Stage1 again.
    +      rowConverter = new RowConverterImpl(conf.getDataFields, conf, null)
    +      rowConverter.initialize()
    +      conf.setCardinalityFinder(rowConverter)
    +
    +      val dataWriter = new DataWriterProcessorStepImpl(conf)
    +
    +      val dataHandlerModel = dataWriter.getDataHandlerModel(0)
    +      var dataHandler: CarbonFactHandler = null
    +      var rowsNotExist = true
    +      while (rows.hasNext) {
    +        if (rowsNotExist) {
    +          rowsNotExist = false
    +          dataHandler = CarbonFactHandlerFactory.createCarbonFactHandler(dataHandlerModel,
    +            CarbonFactHandlerFactory.FactHandlerType.COLUMNAR)
    +          dataHandler.initialise()
    +        }
    +        rowNumber.add(1)
    +        dataWriter.processRow(rows.next(), dataHandler)
    +      }
    +
    +      if (!rowsNotExist) {
    +        dataWriter.finish(dataHandler)
    +      }
    +    } catch {
    +      case e: CarbonDataWriterException =>
    +        LOGGER.error(e, "Failed for table: " + tableName + " in Data Writer Step")
    +        throw new CarbonDataLoadingException("Error while initializing data handler : " + e.getMessage)
    +      case e: Exception =>
    +        LOGGER.error(e, "Failed for table: " + tableName + " in Data Writer Step")
    +        throw new CarbonDataLoadingException("There is an unexpected error: " + e.getMessage, e)
    +    } finally {
    +      if (rowConverter != null) {
    +        rowConverter.finish()
    +      }
    +      // clean up the folders and files created locally for data load operation
    +      CarbonLoaderUtil.deleteLocalDataLoadFolderLocation(model, false)
    --- End diff --
    
    suggest to move this clean up to caller of `writeFunc`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/255/<h2>Build result: FAILURE</span></h2>[...truncated 69.82 KB...][ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :carbondata-spark-common[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkin
 s-slave/workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbondata-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/works
 pace/carbondata-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pom[JENKINS] Archiving 
 /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomchannel stoppedSetting status of a32934e3827991418a0a29a5d7f0f48048a602c2 to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/255/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2340/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121302875
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSortOperates.scala ---
    @@ -0,0 +1,242 @@
    +/*
    + * 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.load
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.datastore.exception.CarbonDataWriterException
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.util.CarbonProperties
    +import org.apache.carbondata.processing.csvload.StringArrayWritable
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.newflow.converter.impl.RowConverterImpl
    +import org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException
    +import org.apache.carbondata.processing.newflow.parser.impl.RowParserImpl
    +import org.apache.carbondata.processing.newflow.sort.SortHelper
    +import org.apache.carbondata.processing.newflow.steps.{DataConverterProcessorStepImpl, DataWriterProcessorStepImpl}
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters
    +import org.apache.carbondata.processing.store.{CarbonFactHandler, CarbonFactHandlerFactory}
    +import org.apache.carbondata.spark.rdd.{NewRddIterator, StringArrayRow}
    +import org.apache.spark.broadcast.Broadcast
    +import org.apache.spark.sql.Row
    +import org.apache.spark.util.LongAccumulator
    +import org.apache.spark.{SparkEnv, TaskContext}
    +
    +import scala.util.Random
    +
    +object GlobalSortOperates {
    +  private val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +
    +  def toStringArrayRow(row: StringArrayWritable, columnCount: Int): StringArrayRow = {
    +    val outRow = new StringArrayRow(new Array[String](columnCount))
    +    outRow.setValues(row.get())
    +  }
    +
    +  def toRDDIterator(
    +      rows: Iterator[Row],
    +      modelBroadcast: Broadcast[CarbonLoadModel]): Iterator[Array[AnyRef]] = {
    +    new Iterator[Array[AnyRef]] {
    +      val iter = new NewRddIterator(rows, modelBroadcast.value, TaskContext.get())
    +
    +      override def hasNext: Boolean = iter.hasNext
    +
    +      override def next(): Array[AnyRef] = iter.next
    +    }
    +  }
    +
    +  def inputFunc(
    +      rows: Iterator[Array[AnyRef]],
    +      index: Int,
    +      currentLoadCount: Int,
    +      modelBroadcast: Broadcast[CarbonLoadModel],
    +      rowNumber: LongAccumulator): Iterator[CarbonRow] = {
    +    val model: CarbonLoadModel = getModelCopy(index, currentLoadCount, modelBroadcast)
    +    val conf = DataLoadProcessBuilder.createConfiguration(model)
    +    val rowParser = new RowParserImpl(conf.getDataFields, conf)
    +
    +    TaskContext.get().addTaskFailureListener { (t: TaskContext, e: Throwable) =>
    +      wrapException(e, model)
    +    }
    +
    +    new Iterator[CarbonRow] {
    +      override def hasNext: Boolean = rows.hasNext
    +
    +      override def next(): CarbonRow = {
    +        rowNumber.add(1)
    --- End diff --
    
    should add after parsing it, please change all `rowNumber.add(1)` places


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2417/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121301479
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSortOperates.scala ---
    @@ -0,0 +1,242 @@
    +/*
    + * 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.load
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.datastore.exception.CarbonDataWriterException
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.util.CarbonProperties
    +import org.apache.carbondata.processing.csvload.StringArrayWritable
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.newflow.converter.impl.RowConverterImpl
    +import org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException
    +import org.apache.carbondata.processing.newflow.parser.impl.RowParserImpl
    +import org.apache.carbondata.processing.newflow.sort.SortHelper
    +import org.apache.carbondata.processing.newflow.steps.{DataConverterProcessorStepImpl, DataWriterProcessorStepImpl}
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters
    +import org.apache.carbondata.processing.store.{CarbonFactHandler, CarbonFactHandlerFactory}
    +import org.apache.carbondata.spark.rdd.{NewRddIterator, StringArrayRow}
    +import org.apache.spark.broadcast.Broadcast
    +import org.apache.spark.sql.Row
    +import org.apache.spark.util.LongAccumulator
    +import org.apache.spark.{SparkEnv, TaskContext}
    +
    +import scala.util.Random
    +
    +object GlobalSortOperates {
    --- End diff --
    
    Name it similar to `AbstractDataLoadProcessorStep`, it contains process functions for all steps


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2416/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by watermen <gi...@git.apache.org>.
Github user watermen commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121315052
  
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/newflow/sort/SortHelper.java ---
    @@ -0,0 +1,85 @@
    +/*
    + * 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.sort;
    +
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters;
    +import org.apache.carbondata.processing.util.NonDictionaryUtil;
    +
    +public class SortHelper {
    --- End diff --
    
    In `SortTempFileChunkHolder.getRowFromStream`, data is from stream, so we can't reuse the function in `SortStepRowUtil`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2409/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/280/<h2>Failed Tests: <span class='status-failure'>10</span></h2><h3><a name='carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test' /><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport'>carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test</a>: <span class='status-failure'>10</span></h3><ul><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Make_sure_the_result_is_right_and_sorted_in_global_level/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Make sure the result is right and sorted in global level</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-com
 mon-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Test_GLOBAL_SORT_with_BAD_RECORDS_ACTION____REDIRECT_/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Test GLOBAL_SORT with BAD_RECORDS_ACTION = 'REDIRECT'</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Don_t_support_GLOBAL_SORT_on_partitioned_table/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Don't support GLOBAL_SORT on partitioned table</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Number_of_partitions_should_be_greater_than_0/'><strong>org.apache.carbondata.spark.testsuite.dataload.Te
 stGlobalSortDataLoad.Number of partitions should be greater than 0</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Compaction_GLOBAL_SORT___2/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Compaction GLOBAL_SORT * 2</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Compaction_GLOBAL_SORT___LOCAL_SORT___BATCH_SORT/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Compaction GLOBAL_SORT + LOCAL_SORT + BATCH_SORT</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.
 testsuite.dataload/TestGlobalSortDataLoad/DDL___carbon_properties/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.DDL > carbon.properties</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/carbon_properties/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.carbon.properties</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/LOAD_with_DELETE/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.LOAD with DELETE</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/280/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apa
 che.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/INSERT_INTO/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.INSERT INTO</strong></a></li></ul>



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/288/<h2>Failed Tests: <span class='status-failure'>5</span></h2><h3><a name='carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test' /><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/288/org.apache.carbondata$carbondata-spark-common-test/testReport'>carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test</a>: <span class='status-failure'>5</span></h3><ul><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/288/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Make_sure_the_result_is_right_and_sorted_in_global_level/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Make sure the result is right and sorted in global level</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/288/org.apache.carbondata$carbondata-spark-commo
 n-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Don_t_support_GLOBAL_SORT_on_partitioned_table/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Don't support GLOBAL_SORT on partitioned table</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/288/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Number_of_partitions_should_be_greater_than_0/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Number of partitions should be greater than 0</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/288/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/DDL___carbon_properties/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.DDL > carbon.proper
 ties</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/288/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/LOAD_with_DELETE/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.LOAD with DELETE</strong></a></li></ul>



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by watermen <gi...@git.apache.org>.
Github user watermen commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121306203
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSort.scala ---
    @@ -0,0 +1,152 @@
    +/*
    + * 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.load
    +
    +import java.util.Comparator
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.constants.CarbonCommonConstants
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.statusmanager.LoadMetadataDetails
    +import org.apache.carbondata.processing.csvload.{CSVInputFormat, StringArrayWritable}
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.{NewRowComparator, NewRowComparatorForNormalDims, SortParameters}
    +import org.apache.carbondata.processing.util.CarbonDataProcessorUtil
    +import org.apache.carbondata.spark.util.CommonUtil
    +import org.apache.hadoop.conf.Configuration
    +import org.apache.hadoop.io.NullWritable
    +import org.apache.hadoop.mapreduce.lib.input.FileInputFormat
    +import org.apache.spark.{SparkContext, TaskContext}
    +import org.apache.spark.rdd.NewHadoopRDD
    +import org.apache.spark.sql.DataFrame
    +import org.apache.spark.sql.execution.command.ExecutionErrors
    +import org.apache.spark.storage.StorageLevel
    +
    +/**
    +  * Use sortBy operator in spark to load the data
    +  */
    +object GlobalSort {
    --- End diff --
    
    Name it to `DataLoadProcess`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2377/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/269/<h2>Failed Tests: <span class='status-failure'>10</span></h2><h3><a name='carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test' /><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport'>carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test</a>: <span class='status-failure'>10</span></h3><ul><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Make_sure_the_result_is_right_and_sorted_in_global_level/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Make sure the result is right and sorted in global level</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-com
 mon-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Test_GLOBAL_SORT_with_BAD_RECORDS_ACTION____REDIRECT_/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Test GLOBAL_SORT with BAD_RECORDS_ACTION = 'REDIRECT'</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Don_t_support_GLOBAL_SORT_on_partitioned_table/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Don't support GLOBAL_SORT on partitioned table</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Number_of_partitions_should_be_greater_than_0/'><strong>org.apache.carbondata.spark.testsuite.dataload.Te
 stGlobalSortDataLoad.Number of partitions should be greater than 0</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Compaction_GLOBAL_SORT___2/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Compaction GLOBAL_SORT * 2</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Compaction_GLOBAL_SORT___LOCAL_SORT___BATCH_SORT/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Compaction GLOBAL_SORT + LOCAL_SORT + BATCH_SORT</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.
 testsuite.dataload/TestGlobalSortDataLoad/DDL___carbon_properties/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.DDL > carbon.properties</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/carbon_properties/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.carbon.properties</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/LOAD_with_DELETE/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.LOAD with DELETE</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/269/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apa
 che.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/INSERT_INTO/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.INSERT INTO</strong></a></li></ul>



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2391/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/296/<h2>Build result: FAILURE</span></h2>[...truncated 52.60 KB...][ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :carbondata-processing[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-
 slave/workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbondata-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspa
 ce/carbondata-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /h
 ome/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomchannel stoppedSetting status of e7da989faab09b08b82416f036d3b8a2474e978e to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/296/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/254/<h2>Build result: FAILURE</span></h2>[...truncated 52.64 KB...][ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :carbondata-processing[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-
 slave/workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbondata-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspa
 ce/carbondata-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /h
 ome/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomchannel stoppedSetting status of 324d92adfb279091b4ffece81e8f0ecafb1ff773 to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/254/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2415/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121301080
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSort.scala ---
    @@ -0,0 +1,152 @@
    +/*
    + * 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.load
    +
    +import java.util.Comparator
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.constants.CarbonCommonConstants
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.statusmanager.LoadMetadataDetails
    +import org.apache.carbondata.processing.csvload.{CSVInputFormat, StringArrayWritable}
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.{NewRowComparator, NewRowComparatorForNormalDims, SortParameters}
    +import org.apache.carbondata.processing.util.CarbonDataProcessorUtil
    +import org.apache.carbondata.spark.util.CommonUtil
    +import org.apache.hadoop.conf.Configuration
    +import org.apache.hadoop.io.NullWritable
    +import org.apache.hadoop.mapreduce.lib.input.FileInputFormat
    +import org.apache.spark.{SparkContext, TaskContext}
    +import org.apache.spark.rdd.NewHadoopRDD
    +import org.apache.spark.sql.DataFrame
    +import org.apache.spark.sql.execution.command.ExecutionErrors
    +import org.apache.spark.storage.StorageLevel
    +
    +/**
    +  * Use sortBy operator in spark to load the data
    +  */
    +object GlobalSort {
    +  private val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +
    +  def loadDataUsingGlobalSort(
    +      sc: SparkContext,
    +      dataFrame: Option[DataFrame],
    +      model: CarbonLoadModel,
    +      currentLoadCount: Int): Array[(String, (LoadMetadataDetails, ExecutionErrors))] = {
    +    val originRDD = if (dataFrame.isDefined) {
    +      dataFrame.get.rdd
    +    } else {
    +      // input data from files
    +      val hadoopConfiguration = new Configuration()
    +      CommonUtil.configureCSVInputFormat(hadoopConfiguration, model)
    +      hadoopConfiguration.set(FileInputFormat.INPUT_DIR, model.getFactFilePath)
    +      val columnCount = model.getCsvHeaderColumns.length
    +      new NewHadoopRDD[NullWritable, StringArrayWritable](
    +        sc,
    +        classOf[CSVInputFormat],
    +        classOf[NullWritable],
    +        classOf[StringArrayWritable],
    +        hadoopConfiguration)
    +        .map(x => GlobalSortOperates.toStringArrayRow(x._2, columnCount))
    +    }
    +
    +    val modelBroadcast = sc.broadcast(model)
    +    val partialSuccessAccum = sc.longAccumulator("Partial Success Accumulator")
    +
    +    val inputStepRowNumber = sc.longAccumulator("Input Processor Accumulator")
    +    val convertStepRowNumber = sc.longAccumulator("Convert Processor Accumulator")
    +    val sortStepRowNumber = sc.longAccumulator("Sort Processor Accumulator")
    +    val writeStepRowNumber = sc.longAccumulator("Write Processor Accumulator")
    +
    +    // 1. Input
    +    val inputRDD = originRDD.mapPartitions(rows => GlobalSortOperates.toRDDIterator(rows, modelBroadcast))
    +      .mapPartitionsWithIndex { case (index, rows) =>
    +        GlobalSortOperates.inputFunc(rows, index, currentLoadCount, modelBroadcast, inputStepRowNumber)
    +      }
    +
    +    // 2. Convert
    +    val convertRDD = inputRDD.mapPartitionsWithIndex { case (index, rows) =>
    +      GlobalSortOperates.convertFunc(rows, index, currentLoadCount, modelBroadcast, partialSuccessAccum,
    +        convertStepRowNumber)
    +    }.filter(_ != null)// Filter the bad record
    +
    +    // 3. Sort
    +    val configuration = DataLoadProcessBuilder.createConfiguration(model)
    +    val sortParameters = SortParameters.createSortParameters(configuration)
    +    object RowOrdering extends Ordering[Array[AnyRef]] {
    +      def compare(rowA: Array[AnyRef], rowB: Array[AnyRef]): Int = {
    +        val rowComparator: Comparator[Array[AnyRef]] =
    +          if (sortParameters.getNoDictionaryCount > 0) {
    +            new NewRowComparator(sortParameters.getNoDictionaryDimnesionColumn)
    +          } else {
    +            new NewRowComparatorForNormalDims(sortParameters.getDimColCount)
    +          }
    +
    +        rowComparator.compare(rowA, rowB)
    +      }
    +    }
    +
    +    var numPartitions = CarbonDataProcessorUtil.getGlobalSortPartitions(configuration)
    +    if (numPartitions <= 0) {
    +      numPartitions = convertRDD.partitions.length// TODO
    +    }
    +
    +    // Because if the number of partitions greater than 1, there will be action operator(sample) in sortBy operator.
    +    // So here we cache the rdd to avoid do input and convert again.
    +    if (numPartitions > 1) {
    +      convertRDD.persist(StorageLevel.MEMORY_AND_DISK)
    +    }
    +
    +    import scala.reflect.classTag
    +    val sortRDD =
    +      convertRDD.sortBy(_.getData, numPartitions = numPartitions)(RowOrdering, classTag[Array[AnyRef]])
    +        .mapPartitionsWithIndex { case (index, rows) =>
    +          GlobalSortOperates.convertTo3Parts(rows, index, currentLoadCount, modelBroadcast, sortStepRowNumber)
    +        }
    +
    +    // 4. Write
    +    sc.runJob(sortRDD, (context: TaskContext, rows: Iterator[CarbonRow]) =>
    +      GlobalSortOperates.writeFunc(rows, context.partitionId, currentLoadCount, modelBroadcast, writeStepRowNumber))
    +
    +    // clean cache
    +    convertRDD.unpersist()
    +
    +    // Log the number of rows in each step
    +    LOGGER.audit("Total rows processed in step Input Processor: " + inputStepRowNumber.value)
    --- End diff --
    
    should not use `audit` level, should be `info` instead


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2376/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/257/<h2>Build result: FAILURE</span></h2>[...truncated 76.32 KB...][ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :carbondata-spark-common[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkin
 s-slave/workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbondata-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/works
 pace/carbondata-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pom[JENKINS] Archiving 
 /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomchannel stoppedSetting status of a30d36bfa9d229528c70f4a7f8259585c650d5a3 to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/257/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2389/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/297/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by watermen <gi...@git.apache.org>.
Github user watermen commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121304254
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSort.scala ---
    @@ -0,0 +1,152 @@
    +/*
    + * 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.load
    +
    +import java.util.Comparator
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.constants.CarbonCommonConstants
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.statusmanager.LoadMetadataDetails
    +import org.apache.carbondata.processing.csvload.{CSVInputFormat, StringArrayWritable}
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.{NewRowComparator, NewRowComparatorForNormalDims, SortParameters}
    +import org.apache.carbondata.processing.util.CarbonDataProcessorUtil
    +import org.apache.carbondata.spark.util.CommonUtil
    +import org.apache.hadoop.conf.Configuration
    +import org.apache.hadoop.io.NullWritable
    +import org.apache.hadoop.mapreduce.lib.input.FileInputFormat
    +import org.apache.spark.{SparkContext, TaskContext}
    +import org.apache.spark.rdd.NewHadoopRDD
    +import org.apache.spark.sql.DataFrame
    +import org.apache.spark.sql.execution.command.ExecutionErrors
    +import org.apache.spark.storage.StorageLevel
    +
    +/**
    +  * Use sortBy operator in spark to load the data
    +  */
    +object GlobalSort {
    --- End diff --
    
    Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Please create an umbrella JIRA and track loading, query, compaction requirement of this new feature 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by watermen <gi...@git.apache.org>.
Github user watermen commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121304371
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSortHelper.scala ---
    @@ -0,0 +1,53 @@
    +/*
    + * 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.load
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.metadata.CarbonTableIdentifier
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException
    +import org.apache.carbondata.processing.surrogatekeysgenerator.csvbased.BadRecordsLogger
    +import org.apache.spark.util.LongAccumulator
    +
    +object GlobalSortHelper {
    +  private val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +
    +  def badRecordsLogger(loadModel: CarbonLoadModel, badRecordsAccum: LongAccumulator): Unit = {
    +    val key = new CarbonTableIdentifier(loadModel.getDatabaseName, loadModel.getTableName, null).getBadRecordLoggerKey
    +    if (null != BadRecordsLogger.hasBadRecord(key)) {
    +      LOGGER.error("Data Load is partially success for table " + loadModel.getTableName)
    +      badRecordsAccum.add(1)
    +    } else {
    +      LOGGER.info("Data loading is successful for table " + loadModel.getTableName)
    +    }
    +  }
    +
    +  def tryWithSafeFinally[T](tableName: String, block: => T)
    --- End diff --
    
    Delete


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/256/<h2>Build result: FAILURE</span></h2>[...truncated 64.69 KB...][ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :carbondata-spark-common[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkin
 s-slave/workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbondata-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/works
 pace/carbondata-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pom[JENKINS] Archiving 
 /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomchannel stoppedSetting status of 22814976288b563a0d3f3d765f66beeeddf77098 to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/256/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by watermen <gi...@git.apache.org>.
Github user watermen commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121305832
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSortOperates.scala ---
    @@ -0,0 +1,242 @@
    +/*
    + * 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.load
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.datastore.exception.CarbonDataWriterException
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.util.CarbonProperties
    +import org.apache.carbondata.processing.csvload.StringArrayWritable
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.newflow.converter.impl.RowConverterImpl
    +import org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException
    +import org.apache.carbondata.processing.newflow.parser.impl.RowParserImpl
    +import org.apache.carbondata.processing.newflow.sort.SortHelper
    +import org.apache.carbondata.processing.newflow.steps.{DataConverterProcessorStepImpl, DataWriterProcessorStepImpl}
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters
    +import org.apache.carbondata.processing.store.{CarbonFactHandler, CarbonFactHandlerFactory}
    +import org.apache.carbondata.spark.rdd.{NewRddIterator, StringArrayRow}
    +import org.apache.spark.broadcast.Broadcast
    +import org.apache.spark.sql.Row
    +import org.apache.spark.util.LongAccumulator
    +import org.apache.spark.{SparkEnv, TaskContext}
    +
    +import scala.util.Random
    +
    +object GlobalSortOperates {
    +  private val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +
    +  def toStringArrayRow(row: StringArrayWritable, columnCount: Int): StringArrayRow = {
    +    val outRow = new StringArrayRow(new Array[String](columnCount))
    +    outRow.setValues(row.get())
    +  }
    +
    +  def toRDDIterator(
    +      rows: Iterator[Row],
    +      modelBroadcast: Broadcast[CarbonLoadModel]): Iterator[Array[AnyRef]] = {
    +    new Iterator[Array[AnyRef]] {
    +      val iter = new NewRddIterator(rows, modelBroadcast.value, TaskContext.get())
    +
    +      override def hasNext: Boolean = iter.hasNext
    +
    +      override def next(): Array[AnyRef] = iter.next
    +    }
    +  }
    +
    +  def inputFunc(
    +      rows: Iterator[Array[AnyRef]],
    +      index: Int,
    +      currentLoadCount: Int,
    +      modelBroadcast: Broadcast[CarbonLoadModel],
    +      rowNumber: LongAccumulator): Iterator[CarbonRow] = {
    +    val model: CarbonLoadModel = getModelCopy(index, currentLoadCount, modelBroadcast)
    +    val conf = DataLoadProcessBuilder.createConfiguration(model)
    +    val rowParser = new RowParserImpl(conf.getDataFields, conf)
    +
    +    TaskContext.get().addTaskFailureListener { (t: TaskContext, e: Throwable) =>
    +      wrapException(e, model)
    +    }
    +
    +    new Iterator[CarbonRow] {
    +      override def hasNext: Boolean = rows.hasNext
    +
    +      override def next(): CarbonRow = {
    +        rowNumber.add(1)
    --- End diff --
    
    Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2403/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by watermen <gi...@git.apache.org>.
Github user watermen commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121305190
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSort.scala ---
    @@ -0,0 +1,152 @@
    +/*
    + * 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.load
    +
    +import java.util.Comparator
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.constants.CarbonCommonConstants
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.statusmanager.LoadMetadataDetails
    +import org.apache.carbondata.processing.csvload.{CSVInputFormat, StringArrayWritable}
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.{NewRowComparator, NewRowComparatorForNormalDims, SortParameters}
    +import org.apache.carbondata.processing.util.CarbonDataProcessorUtil
    +import org.apache.carbondata.spark.util.CommonUtil
    +import org.apache.hadoop.conf.Configuration
    +import org.apache.hadoop.io.NullWritable
    +import org.apache.hadoop.mapreduce.lib.input.FileInputFormat
    +import org.apache.spark.{SparkContext, TaskContext}
    +import org.apache.spark.rdd.NewHadoopRDD
    +import org.apache.spark.sql.DataFrame
    +import org.apache.spark.sql.execution.command.ExecutionErrors
    +import org.apache.spark.storage.StorageLevel
    +
    +/**
    +  * Use sortBy operator in spark to load the data
    +  */
    +object GlobalSort {
    +  private val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +
    +  def loadDataUsingGlobalSort(
    +      sc: SparkContext,
    +      dataFrame: Option[DataFrame],
    +      model: CarbonLoadModel,
    +      currentLoadCount: Int): Array[(String, (LoadMetadataDetails, ExecutionErrors))] = {
    +    val originRDD = if (dataFrame.isDefined) {
    +      dataFrame.get.rdd
    +    } else {
    +      // input data from files
    +      val hadoopConfiguration = new Configuration()
    +      CommonUtil.configureCSVInputFormat(hadoopConfiguration, model)
    +      hadoopConfiguration.set(FileInputFormat.INPUT_DIR, model.getFactFilePath)
    +      val columnCount = model.getCsvHeaderColumns.length
    +      new NewHadoopRDD[NullWritable, StringArrayWritable](
    +        sc,
    +        classOf[CSVInputFormat],
    +        classOf[NullWritable],
    +        classOf[StringArrayWritable],
    +        hadoopConfiguration)
    +        .map(x => GlobalSortOperates.toStringArrayRow(x._2, columnCount))
    +    }
    +
    +    val modelBroadcast = sc.broadcast(model)
    +    val partialSuccessAccum = sc.longAccumulator("Partial Success Accumulator")
    +
    +    val inputStepRowNumber = sc.longAccumulator("Input Processor Accumulator")
    +    val convertStepRowNumber = sc.longAccumulator("Convert Processor Accumulator")
    +    val sortStepRowNumber = sc.longAccumulator("Sort Processor Accumulator")
    +    val writeStepRowNumber = sc.longAccumulator("Write Processor Accumulator")
    +
    +    // 1. Input
    +    val inputRDD = originRDD.mapPartitions(rows => GlobalSortOperates.toRDDIterator(rows, modelBroadcast))
    +      .mapPartitionsWithIndex { case (index, rows) =>
    +        GlobalSortOperates.inputFunc(rows, index, currentLoadCount, modelBroadcast, inputStepRowNumber)
    +      }
    +
    +    // 2. Convert
    +    val convertRDD = inputRDD.mapPartitionsWithIndex { case (index, rows) =>
    +      GlobalSortOperates.convertFunc(rows, index, currentLoadCount, modelBroadcast, partialSuccessAccum,
    +        convertStepRowNumber)
    +    }.filter(_ != null)// Filter the bad record
    +
    +    // 3. Sort
    +    val configuration = DataLoadProcessBuilder.createConfiguration(model)
    +    val sortParameters = SortParameters.createSortParameters(configuration)
    +    object RowOrdering extends Ordering[Array[AnyRef]] {
    +      def compare(rowA: Array[AnyRef], rowB: Array[AnyRef]): Int = {
    +        val rowComparator: Comparator[Array[AnyRef]] =
    +          if (sortParameters.getNoDictionaryCount > 0) {
    +            new NewRowComparator(sortParameters.getNoDictionaryDimnesionColumn)
    +          } else {
    +            new NewRowComparatorForNormalDims(sortParameters.getDimColCount)
    +          }
    +
    +        rowComparator.compare(rowA, rowB)
    +      }
    +    }
    +
    +    var numPartitions = CarbonDataProcessorUtil.getGlobalSortPartitions(configuration)
    +    if (numPartitions <= 0) {
    +      numPartitions = convertRDD.partitions.length// TODO
    +    }
    +
    +    // Because if the number of partitions greater than 1, there will be action operator(sample) in sortBy operator.
    +    // So here we cache the rdd to avoid do input and convert again.
    +    if (numPartitions > 1) {
    +      convertRDD.persist(StorageLevel.MEMORY_AND_DISK)
    +    }
    +
    +    import scala.reflect.classTag
    +    val sortRDD =
    +      convertRDD.sortBy(_.getData, numPartitions = numPartitions)(RowOrdering, classTag[Array[AnyRef]])
    +        .mapPartitionsWithIndex { case (index, rows) =>
    +          GlobalSortOperates.convertTo3Parts(rows, index, currentLoadCount, modelBroadcast, sortStepRowNumber)
    +        }
    +
    +    // 4. Write
    +    sc.runJob(sortRDD, (context: TaskContext, rows: Iterator[CarbonRow]) =>
    +      GlobalSortOperates.writeFunc(rows, context.partitionId, currentLoadCount, modelBroadcast, writeStepRowNumber))
    +
    +    // clean cache
    +    convertRDD.unpersist()
    +
    +    // Log the number of rows in each step
    +    LOGGER.audit("Total rows processed in step Input Processor: " + inputStepRowNumber.value)
    --- End diff --
    
    Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/281/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2401/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/283/<h2>Failed Tests: <span class='status-failure'>10</span></h2><h3><a name='carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test' /><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport'>carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test</a>: <span class='status-failure'>10</span></h3><ul><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Make_sure_the_result_is_right_and_sorted_in_global_level/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Make sure the result is right and sorted in global level</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-com
 mon-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Test_GLOBAL_SORT_with_BAD_RECORDS_ACTION____REDIRECT_/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Test GLOBAL_SORT with BAD_RECORDS_ACTION = 'REDIRECT'</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Don_t_support_GLOBAL_SORT_on_partitioned_table/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Don't support GLOBAL_SORT on partitioned table</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Number_of_partitions_should_be_greater_than_0/'><strong>org.apache.carbondata.spark.testsuite.dataload.Te
 stGlobalSortDataLoad.Number of partitions should be greater than 0</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Compaction_GLOBAL_SORT___2/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Compaction GLOBAL_SORT * 2</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/Compaction_GLOBAL_SORT___LOCAL_SORT___BATCH_SORT/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.Compaction GLOBAL_SORT + LOCAL_SORT + BATCH_SORT</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.
 testsuite.dataload/TestGlobalSortDataLoad/DDL___carbon_properties/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.DDL > carbon.properties</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/carbon_properties/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.carbon.properties</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/LOAD_with_DELETE/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.LOAD with DELETE</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/283/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apa
 che.carbondata.spark.testsuite.dataload/TestGlobalSortDataLoad/INSERT_INTO/'><strong>org.apache.carbondata.spark.testsuite.dataload.TestGlobalSortDataLoad.INSERT INTO</strong></a></li></ul>



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2038/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by watermen <gi...@git.apache.org>.
Github user watermen commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121305557
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSortOperates.scala ---
    @@ -0,0 +1,242 @@
    +/*
    + * 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.load
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.datastore.exception.CarbonDataWriterException
    +import org.apache.carbondata.core.datastore.row.CarbonRow
    +import org.apache.carbondata.core.util.CarbonProperties
    +import org.apache.carbondata.processing.csvload.StringArrayWritable
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.DataLoadProcessBuilder
    +import org.apache.carbondata.processing.newflow.converter.impl.RowConverterImpl
    +import org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException
    +import org.apache.carbondata.processing.newflow.parser.impl.RowParserImpl
    +import org.apache.carbondata.processing.newflow.sort.SortHelper
    +import org.apache.carbondata.processing.newflow.steps.{DataConverterProcessorStepImpl, DataWriterProcessorStepImpl}
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters
    +import org.apache.carbondata.processing.store.{CarbonFactHandler, CarbonFactHandlerFactory}
    +import org.apache.carbondata.spark.rdd.{NewRddIterator, StringArrayRow}
    +import org.apache.spark.broadcast.Broadcast
    +import org.apache.spark.sql.Row
    +import org.apache.spark.util.LongAccumulator
    +import org.apache.spark.{SparkEnv, TaskContext}
    +
    +import scala.util.Random
    +
    +object GlobalSortOperates {
    --- End diff --
    
    Name it to `DataLoadProcessorStep`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2339/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/216/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/295/<h2>Build result: FAILURE</span></h2>[...truncated 78.94 KB...][ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :carbondata-spark[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave
 /workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbondata-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/ca
 rbondata-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/j
 enkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomchannel stoppedSetting status of 7d0b8801f2917d9dd5cbe9debd68322a80d43131 to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/295/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [CARBONDATA-1163] Use spark multi-threads model to lo...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2378/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121300832
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/GlobalSortHelper.scala ---
    @@ -0,0 +1,53 @@
    +/*
    + * 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.load
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +import org.apache.carbondata.core.metadata.CarbonTableIdentifier
    +import org.apache.carbondata.processing.model.CarbonLoadModel
    +import org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException
    +import org.apache.carbondata.processing.surrogatekeysgenerator.csvbased.BadRecordsLogger
    +import org.apache.spark.util.LongAccumulator
    +
    +object GlobalSortHelper {
    +  private val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +
    +  def badRecordsLogger(loadModel: CarbonLoadModel, badRecordsAccum: LongAccumulator): Unit = {
    +    val key = new CarbonTableIdentifier(loadModel.getDatabaseName, loadModel.getTableName, null).getBadRecordLoggerKey
    +    if (null != BadRecordsLogger.hasBadRecord(key)) {
    +      LOGGER.error("Data Load is partially success for table " + loadModel.getTableName)
    +      badRecordsAccum.add(1)
    +    } else {
    +      LOGGER.info("Data loading is successful for table " + loadModel.getTableName)
    +    }
    +  }
    +
    +  def tryWithSafeFinally[T](tableName: String, block: => T)
    --- End diff --
    
    Seems no one is using this function


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2418/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2375/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [WIP] Global sort by spark in load process

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/910#discussion_r121300564
  
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/newflow/sort/SortHelper.java ---
    @@ -0,0 +1,85 @@
    +/*
    + * 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.sort;
    +
    +import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters;
    +import org.apache.carbondata.processing.util.NonDictionaryUtil;
    +
    +public class SortHelper {
    --- End diff --
    
    Name it `SortStepRowUtil` like `WriteStepRowUtil`, it is for changing the format of carbon row. This behavior may change in future, so we better to put all such conversion in one place. So please change `SortTempFileChunkHolder.getRowFromStream` to use this utility. And `UnsafeSingleThreadFinalSortFilesMerger.convertRow` as well


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2010/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #910: [CARBONDATA-1163] Use spark multi-threads mode...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/carbondata/pull/910


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #910: [WIP] Global sort by spark in load process

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/910
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---