Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8388#discussion_r37824305
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala
 ---
    @@ -386,11 +388,46 @@ abstract class HiveComparisonTest
                     hiveCacheFiles.foreach(_.delete())
                   }
     
    +              // If this query is reading other tables that were created 
during this test run
    +              // also print out the query plans and results for those.
    +              val computedTablesMessages = try {
    +                val tablesRead = new 
TestHive.QueryExecution(query).executedPlan.collect {
    +                  case ts: HiveTableScan => ts.relation.tableName
    +                }.toSet
    +
    +                TestHive.reset()
    +                val executions = queryList.map(new 
TestHive.QueryExecution(_))
    +                executions.foreach(_.toRdd)
    +                val tablesGenerated = queryList.zip(executions).flatMap{
    +                  case (q, e) => e.executedPlan.collect {
    +                    case i: InsertIntoHiveTable if tablesRead contains 
i.table.tableName =>
    +                      (q, e, i)
    +                  }
    +                }
    +
    +                tablesGenerated.map { case (hiveql, execution, insert) =>
    +                  s"""
    +                     |
    +                     |=== Generated Table ===
    +                     |$hiveql
    +                     |$execution
    +                     |== Results ==
    +                     |${insert.child.execute().collect().mkString("\n")}
    +                   """.stripMargin
    +                }
    --- End diff --
    
    Needs a mkstring.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to