Skip to content

Commit

Permalink
[native] Add decimal data test for checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
wypb authored and amitkdutta committed Oct 26, 2023
1 parent d4d3ad6 commit a00fdc6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ TEST_F(PrestoQueryRunnerTest, DISABLED_fuzzer) {

auto veloxResults =
velox::exec::test::AssertQueryBuilder(plan).copyResults(pool());
velox::exec::test::assertEqualResults(prestoResults, {veloxResults});
velox::exec::test::assertEqualResults(
prestoResults, plan->outputType(), {veloxResults});
}

} // namespace facebook::presto::test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ public void testChecksum()
assertQuery("SELECT checksum(quantity_by_linenumber) FROM orders_ex");
assertQuery("SELECT shipmode, checksum(extendedprice) FROM lineitem GROUP BY shipmode");
assertQuery("SELECT checksum(from_unixtime(orderkey, '+01:00')) FROM lineitem WHERE orderkey < 20");

// test DECIMAL data
assertQuery("SELECT checksum(a), checksum(b) FROM (VALUES (DECIMAL '1.234', DECIMAL '611180549424.4633133')) AS t(a, b)");
assertQuery("SELECT checksum(a), checksum(b) FROM (VALUES (DECIMAL '1.234', DECIMAL '611180549424.4633133'), (NULL, NULL)) AS t(a, b)");
assertQuery("SELECT checksum(a), checksum(b) FROM (VALUES (DECIMAL '1.234', CAST('2343331593029422743' AS DECIMAL(38, 0))), (CAST('999999999999999999' AS DECIMAL(18, 0)), CAST('99999999999999999999999999999999999999' AS DECIMAL(38, 0)))) AS t(a, b)");
assertQuery("SELECT checksum(a), checksum(b) FROM (VALUES (CAST('999999999999999999' AS DECIMAL(18, 0)), CAST('99999999999999999999999999999999999999' AS DECIMAL(38, 0))), (CAST('-999999999999999999' as DECIMAL(18, 0)), CAST('-99999999999999999999999999999999999999' AS DECIMAL(38, 0)))) AS t(a, b)");
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion presto-native-execution/velox
Submodule velox updated 238 files

0 comments on commit a00fdc6

Please sign in to comment.