Skip to content

Commit

Permalink
review comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ajantha-bhat committed Jul 9, 2019
1 parent bf3ecf8 commit ad66fca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -697,18 +697,20 @@ class CarbonLateDecodeRule extends Rule[LogicalPlan] with PredicateHelper {
marker.pushBinaryMarker(allAttrsNotDecode)
u
case p: Project if relations.nonEmpty =>
val prExps = if (p.projectList.toString().contains("substring")) {
// cannot update data type if substring present in plan.
// because if join is called, attribute in plan is tried to resolve on Integer datatype
// instead of String.
p.projectList
} else {
p.projectList.map { prExp =>
val prExps = p.projectList.map { prExp =>
var isSubstringPresent = false
prExp.transform {
case subStr: Substring =>
isSubstringPresent = true
subStr
}
if (!isSubstringPresent) {
prExp.transform {
case attr: AttributeReference =>
updateDataType(attr, attrMap, allAttrsNotDecode, aliasMap)
}
}.asInstanceOf[Seq[NamedExpression]]
}
prExp
}
Project(prExps, p.child)
case wd: Window if relations.nonEmpty =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import org.scalatest.BeforeAndAfterAll

class SubQueryJoinTestSuite extends Spark2QueryTest with BeforeAndAfterAll {


test("test to check if 2nd level subquery gives correct result") {
sql("drop table if exists t1")
sql("drop table if exists t2")
Expand All @@ -44,6 +43,4 @@ class SubQueryJoinTestSuite extends Spark2QueryTest with BeforeAndAfterAll {
sql("drop table t2")

}


}

0 comments on commit ad66fca

Please sign in to comment.