You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by chenghao-intel <gi...@git.apache.org> on 2015/03/08 05:48:52 UTC

[GitHub] spark pull request: [SPARK-5941] [DataFrame] Postpone the table re...

Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4506#discussion_r26002268
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeSuite.scala ---
    @@ -25,17 +25,24 @@ import org.apache.spark.sql.hive.test.TestHive
      * A set of tests that validates support for Hive SerDe.
      */
     class HiveSerDeSuite extends HiveComparisonTest with BeforeAndAfterAll {
    -
       override def beforeAll() = {
    +    import TestHive._
    +    import org.apache.hadoop.hive.serde2.RegexSerDe
         TestHive.cacheTables = false
    +    sql(s"""CREATE TABLE IF NOT EXISTS sales (key STRING, value INT)
    +       |ROW FORMAT SERDE '${classOf[RegexSerDe].getCanonicalName}'
    +       |WITH SERDEPROPERTIES ("input.regex" = "([^ ]*)\t([^ ]*)")
    +       """.stripMargin)
    +    sql(s"LOAD DATA LOCAL INPATH '${getHiveFile("data/files/sales.txt")}' INTO TABLE sales")
    --- End diff --
    
    Thank you @yhuai for noticing this, actually the `createQueryTest` will clean the table by default (as the second argument `reset=true` by default). And that's also why I moved ahead for the test `Read with RegexSerDe`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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