aboutsummaryrefslogblamecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results/random.sql.out
blob: bca67320fe7bb4069859d78b744a04f9a1b55998 (plain) (tree)



















































































                                                                                                                                                         
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 10


-- !query 0
SELECT rand(0)
-- !query 0 schema
struct<rand(0):double>
-- !query 0 output
0.8446490682263027


-- !query 1
SELECT rand(cast(3 / 7 AS int))
-- !query 1 schema
struct<rand(CAST((CAST(3 AS DOUBLE) / CAST(7 AS DOUBLE)) AS INT)):double>
-- !query 1 output
0.8446490682263027


-- !query 2
SELECT rand(NULL)
-- !query 2 schema
struct<rand(CAST(NULL AS INT)):double>
-- !query 2 output
0.8446490682263027


-- !query 3
SELECT rand(cast(NULL AS int))
-- !query 3 schema
struct<rand(CAST(NULL AS INT)):double>
-- !query 3 output
0.8446490682263027


-- !query 4
SELECT rand(1.0)
-- !query 4 schema
struct<>
-- !query 4 output
org.apache.spark.sql.AnalysisException
cannot resolve 'rand(1.0BD)' due to data type mismatch: argument 1 requires (int or bigint) type, however, '1.0BD' is of decimal(2,1) type.; line 1 pos 7


-- !query 5
SELECT randn(0L)
-- !query 5 schema
struct<randn(0):double>
-- !query 5 output
1.1164209726833079


-- !query 6
SELECT randn(cast(3 / 7 AS long))
-- !query 6 schema
struct<randn(CAST((CAST(3 AS DOUBLE) / CAST(7 AS DOUBLE)) AS BIGINT)):double>
-- !query 6 output
1.1164209726833079


-- !query 7
SELECT randn(NULL)
-- !query 7 schema
struct<randn(CAST(NULL AS INT)):double>
-- !query 7 output
1.1164209726833079


-- !query 8
SELECT randn(cast(NULL AS long))
-- !query 8 schema
struct<randn(CAST(NULL AS BIGINT)):double>
-- !query 8 output
1.1164209726833079


-- !query 9
SELECT rand('1')
-- !query 9 schema
struct<>
-- !query 9 output
org.apache.spark.sql.AnalysisException
cannot resolve 'rand('1')' due to data type mismatch: argument 1 requires (int or bigint) type, however, ''1'' is of string type.; line 1 pos 7