Github user sujith71955 commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/100#discussion_r76519971
--- Diff:
integration/spark/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala
---
@@ -591,29 +591,31 @@ object GlobalDictionaryUtil extends Logging {
val basicRdd = sqlContext.sparkContext.textFile(allDictionaryPath)
.map(x => {
val tokens = x.split("" + CSVWriter.DEFAULT_SEPARATOR)
- var index: Int = 0
+ if (tokens.size != 2) {
+ logError("[ALL_DICTIONARY] Read a bad dictionary record: " + x)
+ }
+ var columnName: String = CarbonCommonConstants.DEFAULT_COLUMN_NAME
var value: String = ""
try {
- index = tokens(0).toInt
+ columnName = csvFileColumns(tokens(0).toInt)
value = tokens(1)
} catch {
case ex: Exception =>
- logError("read a bad dictionary record" + x)
+ logError("[ALL_DICTIONARY] Reset bad dictionary record as
default value")
}
- (index, value)
+ (columnName, value)
})
+
// group by column index, and filter required columns
val requireColumnsList = requireColumns.toList
allDictionaryRdd = basicRdd
.groupByKey()
- .map(x => (csvFileColumns(x._1), x._2))
.filter(x => requireColumnsList.contains(x._1))
} catch {
case ex: Exception =>
- logError("read local dictionary files failed")
+ logError("[ALL_DICTIONARY] Read dictionary files failed. Caused
by" + ex.getMessage)
--- End diff --
ALL_DICTIONARY this term is really required in this context?
---
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.
---