Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charlespnh committed Nov 29, 2023
1 parent 3daf49a commit 9bc237e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void testCorrAllNull() throws Exception {
@Test
public void testCorrAllSameValues() throws Exception {
assertMemoryLeak(() -> {
ddl("create table tbl1 as (select 17.2151921 x, x as y from long_sequence(100))");
ddl("create table tbl1 as (select 17.2151921 x, 17.2151921 y from long_sequence(100))");
assertSql(
"corr\nNaN\n", "select corr(x, y) from tbl1"
);
Expand All @@ -56,7 +56,7 @@ public void testCorrAllSameValues() throws Exception {
@Test
public void testCorrDoubleValues() throws Exception {
assertMemoryLeak(() -> {
ddl("create table tbl1 as (select x cast(x as double), x as y from long_sequence(100))");
ddl("create table tbl1 as (select cast(x as double) x, cast(x as double) y from long_sequence(100))");
assertSql(
"corr\n1.0\n", "select corr(x, y) from tbl1"
);
Expand All @@ -78,7 +78,7 @@ public void testCorrFirstNull() throws Exception {
@Test
public void testCorrFloatValues() throws Exception {
assertMemoryLeak(() -> {
ddl("create table tbl1 as (select x cast(x as float), x as y from long_sequence(100))");
ddl("create table tbl1 as (select cast(x as float) x, cast(x as float) y from long_sequence(100))");
assertSql(
"corr\n1.0\n", "select corr(x, y) from tbl1"
);
Expand All @@ -88,7 +88,7 @@ public void testCorrFloatValues() throws Exception {
@Test
public void testCorrIntValues() throws Exception {
assertMemoryLeak(() -> {
ddl("create table tbl1 as (select x cast(x as int), x as y from long_sequence(100))");
ddl("create table tbl1 as (select cast(x as int) x, cast(x as int) y from long_sequence(100))");
assertSql(
"corr\n1.0\n", "select corr(x, y) from tbl1"
);
Expand Down Expand Up @@ -142,7 +142,7 @@ public void testCorrOverflow() throws Exception {
@Test
public void testCorrSomeNull() throws Exception {
assertMemoryLeak(() -> {
ddl("create table tbl1 as (select x cast(x as double), x as y from long_sequence(100))");
ddl("create table tbl1 as (select cast(x as double) x, cast(x as double) y from long_sequence(100))");
insert("insert into 'tbl1' VALUES (null, null)");
assertSql(
"corr\n1.0\n", "select corr(x, y) from tbl1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testCovarPopOneColumnAllNull() throws Exception {
@Test
public void testCovarPopAllNull() throws Exception {
assertMemoryLeak(() -> assertSql(
"covar_pop\nNaN\n", "select covar_pop(x, y) from (select x cast(null as double), cast(null as double) y from long_sequence(100))"
"covar_pop\nNaN\n", "select covar_pop(x, y) from (select cast(null as double) x, cast(null as double) y from long_sequence(100))"
));
}

Expand All @@ -56,7 +56,7 @@ public void testCovarPopAllSameValues() throws Exception {
@Test
public void testCovarPopDoubleValues() throws Exception {
assertMemoryLeak(() -> {
ddl("create table tbl1 as (select cast(x as double) as x, cast(x as double) y from long_sequence(100))");
ddl("create table tbl1 as (select cast(x as double) x, cast(x as double) y from long_sequence(100))");
assertSql(
"covar_pop\n833.25\n", "select covar_pop(x, y) from tbl1"
);
Expand Down

0 comments on commit 9bc237e

Please sign in to comment.