Skip to content

Commit

Permalink
[HUDI-4799] improve analyzer exception tip when can not resolve expre…
Browse files Browse the repository at this point in the history
…ssion
  • Loading branch information
KnightChess committed Sep 8, 2022
1 parent dbb044b commit a6d1f53
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ case class HoodieResolveReferences(sparkSession: SparkSession) extends Rule[Logi
if sparkAdapter.isHoodieTable(target, sparkSession) && target.resolved =>
val resolver = sparkSession.sessionState.conf.resolver
val resolvedSource = analyzer.execute(source)
try {
analyzer.checkAnalysis(resolvedSource)
} catch {
case e: AnalysisException =>
val ae = new AnalysisException(e.message, e.line, e.startPosition, Option(resolvedSource))
ae.setStackTrace(e.getStackTrace)
throw ae
}

def isInsertOrUpdateStar(assignments: Seq[Assignment]): Boolean = {
if (assignments.isEmpty) {
Expand Down

0 comments on commit a6d1f53

Please sign in to comment.