Github user adrian-wang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4930#discussion_r26731166
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala ---
    @@ -151,7 +152,15 @@ class TestHiveContext(sc: SparkContext) extends 
HiveContext(sc) {
     
       val describedTable = "DESCRIBE (\\w+)".r
     
    +  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() = runSqlHive(hql)
    --- End diff --
    
    @yhuai `runSqlHive` calls Driver.run directly without do substitution, so 
we have to substitute for this and `QueryExecution` both.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to