Skip to content

Commit

Permalink
Add test for constraint framework
Browse files Browse the repository at this point in the history
Add test mentioned in #22171
so as to avoid reintroducing the same problem.
  • Loading branch information
feilong-liu committed Mar 15, 2024
1 parent 3380324 commit 8e82ee4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7504,4 +7504,12 @@ public void testRemoveMapCast()
assertQuery(enableOptimization, "select feature[key] from (values (map(array[cast(1 as varchar), '2', '3', '4'], array[0.3, 0.5, 0.9, 0.1]), cast('2' as varchar)), (map(array[cast(1 as varchar), '2', '3', '4'], array[0.3, 0.5, 0.9, 0.1]), '4')) t(feature, key)",
"values 0.5, 0.1");
}

// Test to guardrail problems in constraint framework mentioned in https://github.com/prestodb/presto/pull/22171
@Test
public void testGuardConstraintFramework()
{
assertQuery("with t as (select orderkey, count(1) cnt from (select * from (select * from orders where 1=0) left join (select partkey, suppkey from lineitem where 1=0) on partkey=10 where suppkey is not null) group by rollup(orderkey)) select t1.orderkey, t1.cnt from t t1 cross join t t2",
"values (null, 0)");
}
}

0 comments on commit 8e82ee4

Please sign in to comment.