Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-479

Guarantee consistency for keyword LOCAL and file path in data loading command

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      In CarbonSqlParser.scala,
      protected lazy val loadDataNew: Parser[LogicalPlan] =
      LOAD ~> DATA ~> opt(LOCAL) ~> INPATH ~> stringLit ~ opt(OVERWRITE) ~
      (INTO > TABLE ~> (ident < ".").? ~ ident) ~
      (OPTIONS > "(" ~> repsep(loadOptions, ",") < ")").? <~ opt(";") ^^ {
      case filePath ~ isOverwrite ~ table ~ optionsList =>
      val (databaseNameOp, tableName) = table match

      { case databaseName ~ tableName => (databaseName, tableName.toLowerCase()) }

      if (optionsList.isDefined)

      { validateOptions(optionsList) }

      val optionsMap = optionsList.getOrElse(List.empty[(String, String)]).toMap
      LoadTable(databaseNameOp, tableName, filePath, Seq(), optionsMap,
      isOverwrite.isDefined)
      }

      It seems that using Keyword LOCAL impacts noting. Loading data from hdfs or file just depends on the path.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Lionx Lionx
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: