Skip to content

Commit

Permalink
Test with NaN, -0.0, +0.0, larger negative+positive values
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Sep 15, 2023
1 parent 1b312e1 commit 15bda03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ public void testCreatePartitionContext() throws Exception {
makeInternalRow(1, "1", 2.5),
makeInternalRow(2, "2", 5.0),
makeInternalRow(3, "3", Double.POSITIVE_INFINITY),
makeInternalRow(4, "4", Double.NEGATIVE_INFINITY));
makeInternalRow(4, "4", Double.NEGATIVE_INFINITY),
makeInternalRow(5, "5", Double.NaN),
makeInternalRow(6, "6", 100000000017.100000000017),
makeInternalRow(7, "7", -0.0),
makeInternalRow(8, "8", +0.0),
makeInternalRow(9, "9", -19999997.9));
List<InternalRow> gotRows = new ArrayList<>();

CopyOnWriteArrayList<InternalRow> al = new CopyOnWriteArrayList<>();
Expand Down
7 changes: 6 additions & 1 deletion spark-3.1-spanner-lib/src/test/resources/db/insert_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ VALUES
(1, "1", 2.5),
(2, "2", 5.0),
(3, "3", CAST("+inf" AS FLOAT64)),
(4, "4", CAST("-inf" AS FLOAT64));
(4, "4", CAST("-inf" AS FLOAT64)),
(5, "5", CAST("NaN" AS FLOAT64)),
(6, "6", 100000000017.100000000017),
(7, "7", -0.0),
(8, "8", +0.0),
(9, "9", -19999997.9);

DELETE FROM players WHERE 1=1;
DELETE FROM games WHERE 1=1;
Expand Down

0 comments on commit 15bda03

Please sign in to comment.