Github user ravipesala commented on a diff in the pull request: https://github.com/apache/carbondata/pull/954#discussion_r118870649 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/optimizer/CarbonLateDecodeRule.scala --- @@ -113,6 +114,25 @@ class CarbonLateDecodeRule extends Rule[LogicalPlan] with PredicateHelper { output } + private def processPlan(plan: LogicalPlan): LogicalPlan = { + plan transform { + case ProjectForUpdate(table, cols, Seq(updatePlan)) => + var isTransformed = false + val newPlan = updatePlan transform { + case Project(pList, child) if (!isTransformed) => + val (dest: Seq[NamedExpression], source: Seq[NamedExpression]) = pList + .splitAt(pList.size - cols.size) + val diff = cols.diff(dest.map(_.name)) + if (diff.size > 0) { + sys.error(s"Unknown column(s) ${diff.mkString(",")} in table ${table.tableName}") + } + isTransformed = true + Project(dest.filter(a => !cols.contains(a.name)) ++ source, child) + } + ProjectForUpdateCommand(newPlan, Seq(table.tableIdentifier.toString())) --- End diff -- Cannot be sent as toString as it gived wrong value if you use db name.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---