Github user sounakr commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1469#discussion_r153076600
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonAnalysisRules.scala
---
@@ -58,6 +57,8 @@ object CarbonPreInsertionCasts extends Rule[LogicalPlan] {
)
}
if (child.output.size >= relation.carbonRelation.output.size) {
+ sparkVersion21 = !CarbonClassReflectionUtils.hasField("query",
InsertIntoCarbonTable)
--- End diff --
In some places the SparkContext or SparkSession is directly not available.
Therefore used the approach of accessing the field and if not present the
assume it as other version.
---