Skip to content
  • Dongjoon Hyun's avatar
    df589be5
    [SPARK-18897][SPARKR] Fix SparkR SQL Test to drop test table · df589be5
    Dongjoon Hyun authored
    
    
    ## What changes were proposed in this pull request?
    
    SparkR tests, `R/run-tests.sh`, succeeds only once because `test_sparkSQL.R` does not clean up the test table, `people`.
    
    As a result, the rows in `people` table are accumulated at every run and the test cases fail.
    
    The following is the failure result for the second run.
    
    ```r
    Failed -------------------------------------------------------------------------
    1. Failure: create DataFrame from RDD (test_sparkSQL.R#204) -------------------
    collect(sql("SELECT age from people WHERE name = 'Bob'"))$age not equal to c(16).
    Lengths differ: 2 vs 1
    
    2. Failure: create DataFrame from RDD (test_sparkSQL.R#206) -------------------
    collect(sql("SELECT height from people WHERE name ='Bob'"))$height not equal to c(176.5).
    Lengths differ: 2 vs 1
    ```
    
    ## How was this patch tested?
    
    Manual. Run `run-tests.sh` twice and check if it passes without failures.
    
    Author: Dongjoon Hyun <dongjoon@apache.org>
    
    Closes #16310 from dongjoon-hyun/SPARK-18897.
    
    (cherry picked from commit 1169db44)
    Signed-off-by: default avatarShivaram Venkataraman <shivaram@cs.berkeley.edu>
    df589be5
    [SPARK-18897][SPARKR] Fix SparkR SQL Test to drop test table
    Dongjoon Hyun authored
    
    
    ## What changes were proposed in this pull request?
    
    SparkR tests, `R/run-tests.sh`, succeeds only once because `test_sparkSQL.R` does not clean up the test table, `people`.
    
    As a result, the rows in `people` table are accumulated at every run and the test cases fail.
    
    The following is the failure result for the second run.
    
    ```r
    Failed -------------------------------------------------------------------------
    1. Failure: create DataFrame from RDD (test_sparkSQL.R#204) -------------------
    collect(sql("SELECT age from people WHERE name = 'Bob'"))$age not equal to c(16).
    Lengths differ: 2 vs 1
    
    2. Failure: create DataFrame from RDD (test_sparkSQL.R#206) -------------------
    collect(sql("SELECT height from people WHERE name ='Bob'"))$height not equal to c(176.5).
    Lengths differ: 2 vs 1
    ```
    
    ## How was this patch tested?
    
    Manual. Run `run-tests.sh` twice and check if it passes without failures.
    
    Author: Dongjoon Hyun <dongjoon@apache.org>
    
    Closes #16310 from dongjoon-hyun/SPARK-18897.
    
    (cherry picked from commit 1169db44)
    Signed-off-by: default avatarShivaram Venkataraman <shivaram@cs.berkeley.edu>
Loading