Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
only substitute for parseSql
  • Loading branch information
adrian-wang committed Mar 23, 2015
commit b1d68bfde905d469369d85fc7f935f1089b26c36
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,13 @@ class TestHiveContext(sc: SparkContext) extends HiveContext(sc) {

val vs = new VariableSubstitution()

protected[hive] class HiveQLQueryExecution(hql: String)
extends this.SubstitutedHiveQLQueryExecution(vs.substitute(hiveconf, hql))

// we should substitute variables in hql to pass the text to parseSql() as a parameter.
// Hive parser need substituted text. HiveContext.sql() does this but return a DataFrame,
// while we need a logicalPlan so we cannot reuse that.
protected[hive] class SubstitutedHiveQLQueryExecution(hql: String)
extends this.QueryExecution(HiveQl.parseSql(hql)) {
def hiveExec(): Seq[String] = runSqlHive(hql)
override def toString: String = hql + "\n" + super.toString
protected[hive] class HiveQLQueryExecution(hql: String)
extends this.QueryExecution(HiveQl.parseSql(vs.substitute(hiveconf, hql))) {
def hiveExec() = runSqlHive(hql)
override def toString = hql + "\n" + super.toString
}

/**
Expand Down