Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1133#discussion_r125681145
--- Diff:
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
---
@@ -441,6 +441,38 @@ case class LoadTable(
val batchSortSizeInMB = options.getOrElse("batch_sort_size_inmb",
null)
val globalSortPartitions =
options.getOrElse("global_sort_partitions", null)
ValidateUtil.validateGlobalSortPartitions(globalSortPartitions)
+
+ // if there isn't file header in csv file and load sql doesn't
provide FILEHEADER option,
+ // we should use table schema to generate file header.
+ val headerOption = options.get("header")
+ headerOption.isDefined match {
+ case true =>
+ // whether the csv file has file header
+ // the default value is true
+ val header = try {
+ headerOption.get.toBoolean
+ } catch {
+ case ex: IllegalArgumentException =>
+ throw new MalformedCarbonCommandException(
+ "The 'header' option is not correct. " + ex.getMessage)
+ }
+ header match {
+ case true =>
+ if (fileHeader.nonEmpty) {
+ throw new MalformedCarbonCommandException(
+ "When 'header' option is true, no need 'fileheader'
option.")
--- End diff --
suggest change to "When 'header' option is true, 'fileheader' option is not
required"
---
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 [email protected] or file a JIRA ticket
with INFRA.
---