aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results/random.sql.out
blob: bca67320fe7bb4069859d78b744a04f9a1b55998 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
-- 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