Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
AngersZhuuuu committed Apr 19, 2021
1 parent 76a746e commit 6aa05fc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
19 changes: 11 additions & 8 deletions sql/core/src/test/resources/sql-tests/inputs/transform.sql
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,17 @@ FROM script_trans
WHERE a <= 4
WINDOW w AS (PARTITION BY b ORDER BY a);

SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING), myCol, myCol2)
USING 'cat' AS (a, b, c, d, e)
FROM script_trans
LATERAL VIEW explode(array(array(1,2,3))) myTable AS myCol
LATERAL VIEW explode(myTable.myCol) myTable2 AS myCol2
WHERE a <= 4
GROUP BY b, myCol, myCol2
HAVING max(a) > 1;
SELECT a, b, c, CAST(d AS STriNG), e
FROM (
SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING), myCol, myCol2)
USING 'cat' AS (a, b, c, d, e)
FROM script_trans
LATERAL VIEW explode(array(array(1,2,3))) myTable AS myCol
LATERAL VIEW explode(myTable.myCol) myTable2 AS myCol2
WHERE a <= 4
GROUP BY b, myCol, myCol2
HAVING max(a) > 1
) tmp;

FROM(
FROM script_trans
Expand Down
25 changes: 14 additions & 11 deletions sql/core/src/test/resources/sql-tests/results/transform.sql.out
Original file line number Diff line number Diff line change
Expand Up @@ -494,20 +494,23 @@ struct<a:string,b:string,c:string>


-- !query
SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING), myCol, myCol2)
USING 'cat' AS (a, b, c, d, e)
FROM script_trans
LATERAL VIEW explode(array(array(1,2,3))) myTable AS myCol
LATERAL VIEW explode(myTable.myCol) myTable2 AS myCol2
WHERE a <= 4
GROUP BY b, myCol, myCol2
HAVING max(a) > 1
SELECT a, b, c, CAST(d AS STriNG), e
FROM (
SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING), myCol, myCol2)
USING 'cat' AS (a, b, c, d, e)
FROM script_trans
LATERAL VIEW explode(array(array(1,2,3))) myTable AS myCol
LATERAL VIEW explode(myTable.myCol) myTable2 AS myCol2
WHERE a <= 4
GROUP BY b, myCol, myCol2
HAVING max(a) > 1
) tmp
-- !query schema
struct<a:string,b:string,c:string,d:string,e:string>
-- !query output
5 4 6 [1, 2, 3] 1
5 4 6 [1, 2, 3] 2
5 4 6 [1, 2, 3] 3
5 4 6 [1,2,3] 1
5 4 6 [1,2,3] 2
5 4 6 [1,2,3] 3


-- !query
Expand Down

0 comments on commit 6aa05fc

Please sign in to comment.