Skip to content

Commit b1d68bf

Browse files
committed
only substitute for parseSql
1 parent 9c4a950 commit b1d68bf

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,13 @@ class TestHiveContext(sc: SparkContext) extends HiveContext(sc) {
156156

157157
val vs = new VariableSubstitution()
158158

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

171168
/**

0 commit comments

Comments
 (0)