carbondata-issues mailing list archives

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

    https://github.com/apache/incubator-carbondata/pull/494#discussion_r94544073
  
    --- 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 --
    
    use `FileInputFormat.addInput`


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