Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/597#discussion_r100721184
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
---
@@ -175,16 +175,25 @@ case class CarbonDictionaryDecoder(
val unsafeProjection =
UnsafeProjection.create(output.map(_.dataType).toArray)
var flag = true
var total = 0L
+
override final def hasNext: Boolean = iter.hasNext
+
override final def next(): InternalRow = {
val startTime = System.currentTimeMillis()
val row: InternalRow = iter.next()
val data = row.toSeq(dataTypes).toArray
dictIndex.foreach { index =>
if (data(index) != null) {
- data(index) =
DataTypeUtil.getDataBasedOnDataType(dicts(index)
-
.getDictionaryValueForKey(data(index).asInstanceOf[Int]),
- getDictionaryColumnIds(index)._3)
+ try {
+ data(index) =
DataTypeUtil.getDataBasedOnDataType(dicts(index)
+
.getDictionaryValueForKey(data(index).asInstanceOf[Int]),
+ getDictionaryColumnIds(index)._3)
+ }
+ catch {
+ case x: ClassCastException => {
--- End diff --
How just exception logging could solve the issue? It can create some other
issue, please try to avoid classcast exception first.
---
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.
---