You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2017/03/18 10:04:50 UTC

[GitHub] spark pull request #17338: [SPARK-19990][SQL][test-maven]create a temp file ...

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

    https://github.com/apache/spark/pull/17338#discussion_r106777796
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala ---
    @@ -700,20 +701,33 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils {
     
       test("create temporary view using") {
         val csvFile =
    -      Thread.currentThread().getContextClassLoader.getResource("test-data/cars.csv").toString
    -    withView("testview") {
    -      sql(s"CREATE OR REPLACE TEMPORARY VIEW testview (c1 String, c2 String)  USING " +
    -        "org.apache.spark.sql.execution.datasources.csv.CSVFileFormat  " +
    -        s"OPTIONS (PATH '$csvFile')")
    +      Thread.currentThread().getContextClassLoader.getResourceAsStream("test-data/cars.csv")
    --- End diff --
    
    But isn't the resource you're retrieving to copy still the 'wrong' resource, because you accessed it by a relative path?
    If you say it definitely resolve the problem because you've tested it I do believe it, but I'm not clear why it differs.


---
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