carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From QiangCai <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #494: [CARBONDATA-218]Using CSVInputFormat...
Date Wed, 04 Jan 2017 08:43:03 GMT
Github user QiangCai commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/494#discussion_r94545504
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala
---
    @@ -356,37 +363,49 @@ object GlobalDictionaryUtil {
        */
       def loadDataFrame(sqlContext: SQLContext,
           carbonLoadModel: CarbonLoadModel): DataFrame = {
    -    val df = sqlContext.read
    -      .format("com.databricks.spark.csv.newapi")
    -      .option("header", {
    -        if (StringUtils.isEmpty(carbonLoadModel.getCsvHeader)) {
    -          "true"
    -        } else {
    -          "false"
    -        }
    -      })
    -      .option("delimiter", {
    -        if (StringUtils.isEmpty(carbonLoadModel.getCsvDelimiter)) {
    -          "" + DEFAULT_SEPARATOR
    -        } else {
    -          carbonLoadModel.getCsvDelimiter
    +      val hadoopConfiguration = new Configuration()
    +      CommonUtil.configureCSVInputFormat(hadoopConfiguration, carbonLoadModel)
    +      hadoopConfiguration.set(FileInputFormat.INPUT_DIR, carbonLoadModel.getFactFilePath)
    --- End diff --
    
    FileInputFormat.addInputPath method need a Job type paramter.
    In addition, this FactFilePath already consist of all file path, we can directly set input
path, no need to separate path and add path again. 


---
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.
---

Mime
View raw message