Skip to content

Commit 4b0149c

Browse files
committed
Fix
1 parent d454452 commit 4b0149c

File tree

10 files changed

+546
-433
lines changed

10 files changed

+546
-433
lines changed

sql/core/src/test/resources/sql-tests/inputs/postgreSQL/float4.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ SELECT float('infinity');
4646
SELECT float(' -INFINiTY ');
4747
-- [SPARK-27923] Spark SQL insert there bad special inputs to NULL
4848
-- bad special inputs
49-
-- SELECT float('N A N');
50-
-- SELECT float('NaN x');
51-
-- SELECT float(' INFINITY x');
49+
SELECT float('N A N');
50+
SELECT float('NaN x');
51+
SELECT float(' INFINITY x');
5252

5353
SELECT float('Infinity') + 100.0;
5454
SELECT float('Infinity') / float('Infinity');
5555
SELECT float('nan') / float('nan');
56-
-- SELECT float(decimal('nan'));
56+
SELECT float(decimal('nan'));
5757

5858
SELECT '' AS five, * FROM FLOAT4_TBL;
5959

sql/core/src/test/resources/sql-tests/inputs/postgreSQL/float8.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ SELECT double('infinity');
4545
SELECT double(' -INFINiTY ');
4646
-- [SPARK-27923] Spark SQL insert there bad special inputs to NULL
4747
-- bad special inputs
48-
-- SELECT double('N A N');
49-
-- SELECT double('NaN x');
50-
-- SELECT double(' INFINITY x');
48+
SELECT double('N A N');
49+
SELECT double('NaN x');
50+
SELECT double(' INFINITY x');
5151

5252
SELECT double('Infinity') + 100.0;
5353
SELECT double('Infinity') / double('Infinity');
5454
SELECT double('NaN') / double('NaN');
5555
-- [SPARK-28315] Decimal can not accept NaN as input
56-
-- SELECT double(decimal('nan'));
56+
SELECT double(decimal('nan'));
5757

5858
SELECT '' AS five, * FROM FLOAT8_TBL;
5959

sql/core/src/test/resources/sql-tests/inputs/postgreSQL/text.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ select length(42);
2525
-- casting to text in concatenations, so long as the other input is text or
2626
-- an unknown literal. So these work:
2727
-- [SPARK-28033] String concatenation low priority than other arithmeticBinary
28-
-- select string('four: ') || 2+2;
29-
-- select 'four: ' || 2+2;
28+
select string('four: ') || 2+2;
29+
select 'four: ' || 2+2;
3030

3131
-- but not this:
3232
-- Spark SQL implicit cast both side to string

sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part2.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,10 @@ from numerics
281281
window w as (order by f_numeric range between
282282
1 preceding and 1.1 following); -- currently unsupported
283283

284-
-- select id, f_numeric, first(id) over w, last(id) over w
285-
-- from numerics
286-
-- window w as (order by f_numeric range between
287-
-- 1.1 preceding and 'NaN' following); -- error, NaN disallowed
284+
select id, f_numeric, first(id) over w, last(id) over w
285+
from numerics
286+
window w as (order by f_numeric range between
287+
1.1 preceding and 'NaN' following); -- error, NaN disallowed
288288

289289
drop table empsalary;
290290
drop table numerics;

sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part4.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,9 @@ SELECT i,SUM(v) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
368368

369369
-- [SPARK-29638] Spark handles 'NaN' as 0 in sums
370370
-- ensure aggregate over numeric properly recovers from NaN values
371-
-- SELECT a, b,
372-
-- SUM(b) OVER(ORDER BY A ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
373-
-- FROM (VALUES(1,1),(2,2),(3,(cast('nan' as int))),(4,3),(5,4)) t(a,b);
371+
SELECT a, b,
372+
SUM(b) OVER(ORDER BY A ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
373+
FROM (VALUES(1,1),(2,2),(3,(cast('nan' as int))),(4,3),(5,4)) t(a,b);
374374

375375
-- It might be tempting for someone to add an inverse trans function for
376376
-- float and double precision. This should not be done as it can give incorrect

0 commit comments

Comments
 (0)