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

    https://github.com/apache/spark/pull/14676#discussion_r75228342
  
    --- Diff: 
sql/core/src/test/resources/sql-tests/results/inline-table.sql.out ---
    @@ -0,0 +1,135 @@
    +-- Automatically generated by SQLQueryTestSuite
    +-- Number of queries: 15
    +
    +
    +-- !query 0
    +select * from values ("one", 1)
    +-- !query 0 schema
    +struct<col1:string,col2:int>
    +-- !query 0 output
    +one        1
    +
    +
    +-- !query 1
    +select * from values ("one", 1) as data
    +-- !query 1 schema
    +struct<col1:string,col2:int>
    +-- !query 1 output
    +one        1
    +
    +
    +-- !query 2
    +select * from values ("one", 1) as data(a, b)
    +-- !query 2 schema
    +struct<a:string,b:int>
    +-- !query 2 output
    +one        1
    +
    +
    +-- !query 3
    +select * from values ("one", 1), ("two", 2), ("three", null) as data(a, b)
    +-- !query 3 schema
    +struct<a:string,b:int>
    +-- !query 3 output
    +one        1
    +three      NULL
    +two        2
    +
    +
    +-- !query 4
    +select * from values ("one", null), ("two", null) as data(a, b)
    +-- !query 4 schema
    +struct<a:string,b:null>
    +-- !query 4 output
    +one        NULL
    +two        NULL
    +
    +
    +-- !query 5
    +select * from values ("one", 1), ("two", 2L) as data(a, b)
    +-- !query 5 schema
    +struct<a:string,b:bigint>
    +-- !query 5 output
    +one        1
    +two        2
    +
    +
    +-- !query 6
    +select * from values ("one", 1 + 0), ("two", 1 + 3L) as data(a, b)
    +-- !query 6 schema
    +struct<a:string,b:bigint>
    +-- !query 6 output
    +one        1
    +two        4
    +
    +
    +-- !query 7
    +select * from values ("one", array(0, 1)), ("two", array(2, 3)) as data(a, 
b)
    +-- !query 7 schema
    +struct<a:string,b:array<int>>
    +-- !query 7 output
    +one        [0,1]
    +two        [2,3]
    +
    +
    +-- !query 8
    +select * from values ("one", 2.0), ("two", 3.0D) as data(a, b)
    +-- !query 8 schema
    +struct<a:string,b:double>
    +-- !query 8 output
    +one        2.0
    +two        3.0
    +
    +
    +-- !query 9
    +select * from values ("one", rand(5)), ("two", 3.0D) as data(a, b)
    +-- !query 9 schema
    +struct<a:string,b:double>
    +-- !query 9 output
    +one        0.087440518337355
    +two        3.0
    +
    +
    +-- !query 10
    +select * from values ("one", 2.0), ("two") as data(a, b)
    +-- !query 10 schema
    +struct<>
    +-- !query 10 output
    +org.apache.spark.sql.AnalysisException
    +expected 2 columns but found 1 columns in row 1; line 1 pos 14
    +
    +
    +-- !query 11
    +select * from values ("one", array(0, 1)), ("two", struct(1, 2)) as 
data(a, b)
    +-- !query 11 schema
    +struct<>
    +-- !query 11 output
    +org.apache.spark.sql.AnalysisException
    +incompatible types found in column b for inline table; line 1 pos 14
    +
    +
    +-- !query 12
    +select * from values ("one"), ("two") as data(a, b)
    +-- !query 12 schema
    +struct<>
    +-- !query 12 output
    +org.apache.spark.sql.AnalysisException
    +expected 2 columns but found 1 in first row; line 1 pos 14
    +
    +
    +-- !query 13
    +select * from values ("one", random_not_exist_func(1)), ("two", 2) as 
data(a, b)
    +-- !query 13 schema
    +struct<>
    +-- !query 13 output
    +org.apache.spark.sql.AnalysisException
    +Undefined function: 'random_not_exist_func'. This function is neither a 
registered temporary function nor a permanent function registered in the 
database 'default'.; line 1 pos 29
    +
    +
    +-- !query 14
    +select * from values ("one", count(1)), ("two", 2) as data(a, b)
    +-- !query 14 schema
    +struct<>
    +-- !query 14 output
    +java.lang.UnsupportedOperationException
    +Cannot evaluate expression: count(1)
    --- End diff --
    
    this is not a great exception because it is thrown by the projection - not 
during analysis.



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