Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrn5 committed May 30, 2019
1 parent c8c0211 commit c13abfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Expand Up @@ -71,7 +71,7 @@ class MVAnalyzerRule(sparkSession: SparkSession) extends Rule[LogicalPlan] {
DataMapClassProvider.MV.getShortName).asInstanceOf[SummaryDatasetCatalog]
if (needAnalysis && catalog != null && isValidPlan(plan, catalog)) {
val modularPlan = catalog.mvSession.sessionState.rewritePlan(plan).withMVTable
if (modularPlan.find (_.rewritten).isDefined) {
if (modularPlan.find(_.rewritten).isDefined) {
val compactSQL = modularPlan.asCompactSQL
val analyzed = sparkSession.sql(compactSQL).queryExecution.analyzed
analyzed
Expand Down
Expand Up @@ -161,7 +161,7 @@ trait SQLBuildDSL {
extractRewrittenOrNonRewrittenSelectGroupBySelect(s1, g, s2, alias)

case g@modular.GroupBy(_, _, _, _, s2@modular.Select(_, _, _, _, _, _, _, _, _, _), _, _, _)
if (g.alias.isEmpty && !s2.rewritten) =>
if (g.alias.isEmpty) =>
val fragmentList = s2.children.zipWithIndex
.map { case (child, index) => fragmentExtract(child, s2.aliasMap.get(index)) }
val fList = s2.joinEdges.map {
Expand Down
Expand Up @@ -124,7 +124,11 @@ class SQLBuilder private(
}
} else {
attrMap.get(ref) match {
case Some(alias) => Alias(alias.child, alias.name)(exprId = alias.exprId)
case Some(alias) =>
AttributeReference(
alias.child.asInstanceOf[AttributeReference].name,
ref.dataType)(exprId = ref.exprId,
alias.child.asInstanceOf[AttributeReference].qualifier)
case None => ref
}
}
Expand Down

0 comments on commit c13abfd

Please sign in to comment.