Skip to content

Commit ebdaf61

Browse files
committed
fix UT error
1 parent 9c3df7d commit ebdaf61

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

sql/core/src/test/resources/sql-tests/inputs/udaf-regrfunctions.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ CREATE OR REPLACE TEMPORARY VIEW t1 AS SELECT * FROM VALUES
4747
(800, 7, 1, 1)
4848
as t1(id, px, y, x);
4949

50+
set spark.sql.codegen.wholeStage=false;
51+
5052
select px, var_pop(x), var_pop(y), corr(y,x), covar_samp(y,x), covar_pop(y,x), regr_count(y,x),
5153
regr_slope(y,x), regr_intercept(y,x), regr_r2(y,x), regr_sxx(y,x), regr_syy(y,x), regr_sxy(y,x),
5254
regr_avgx(y,x), regr_avgy(y,x), regr_count(y,x)

sql/core/src/test/resources/sql-tests/results/udaf-regrfunctions.sql.out

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Automatically generated by SQLQueryTestSuite
2-
-- Number of queries: 3
2+
-- Number of queries: 4
33

44

55
-- !query 0
@@ -41,13 +41,21 @@ struct<>
4141

4242

4343
-- !query 1
44+
set spark.sql.codegen.wholeStage=false
45+
-- !query 1 schema
46+
struct<key:string,value:string>
47+
-- !query 1 output
48+
spark.sql.codegen.wholeStage false
49+
50+
51+
-- !query 2
4452
select px, var_pop(x), var_pop(y), corr(y,x), covar_samp(y,x), covar_pop(y,x), regr_count(y,x),
4553
regr_slope(y,x), regr_intercept(y,x), regr_r2(y,x), regr_sxx(y,x), regr_syy(y,x), regr_sxy(y,x),
4654
regr_avgx(y,x), regr_avgy(y,x), regr_count(y,x)
4755
from t1 group by px order by px
48-
-- !query 1 schema
56+
-- !query 2 schema
4957
struct<px:int,var_pop(CAST(x AS DOUBLE)):double,var_pop(CAST(y AS DOUBLE)):double,corr(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,covar_samp(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,covar_pop(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_count(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):bigint,regr_slope(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_intercept(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_r2(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_sxx(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_syy(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_sxy(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_avgx(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_avgy(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,regr_count(CAST(y AS DOUBLE), CAST(x AS DOUBLE)):bigint>
50-
-- !query 1 output
58+
-- !query 2 output
5159
1 1.25 1.25 1.0 1.6666666666666667 1.25 4 1.0 0.0 1.0 5.0 5.0 5.0 2.5 2.5 4
5260
2 1.25 0.0 NULL 0.0 0.0 4 0.0 1.0 1.0 5.0 0.0 0.0 2.5 1.0 4
5361
3 0.0 1.25 NULL 0.0 0.0 4 NULL NULL NULL 0.0 5.0 0.0 1.0 2.5 4
@@ -57,11 +65,11 @@ struct<px:int,var_pop(CAST(x AS DOUBLE)):double,var_pop(CAST(y AS DOUBLE)):doubl
5765
7 0.0 0.0 NaN NaN 0.0 1 NULL NULL NULL 0.0 0.0 0.0 1.0 1.0 1
5866

5967

60-
-- !query 2
68+
-- !query 3
6169
select id, regr_count(y,x) over (partition by px) from t1 order by id
62-
-- !query 2 schema
70+
-- !query 3 schema
6371
struct<id:int,regr_count(CAST(y AS DOUBLE), CAST(x AS DOUBLE)) OVER (PARTITION BY px ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING):bigint>
64-
-- !query 2 output
72+
-- !query 3 output
6573
101 4
6674
102 4
6775
103 4

0 commit comments

Comments
 (0)