AMashenkov commented on code in PR #1583:
URL: https://github.com/apache/ignite-3/pull/1583#discussion_r1094415762
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItOrToUnionRuleTest.java:
##########
@@ -116,46 +114,47 @@ public void testEqualityOrToUnionAllRewrite() {
}
/**
- * Check 'OR -> UNION' rule is not applied for equality conditions on
indexed columns. Multibounds condition is used instead.
+ * Check 'OR -> UNION' rule is applied for mixed conditions on indexed
columns.
*
* @throws Exception If failed.
*/
@Test
- public void testNonDistinctOrToUnionAllRewrite() {
+ public void testMixedOrToUnionAllRewrite() {
assertQuery("SELECT * "
+ "FROM products "
- + "WHERE subcategory = 'Camera Lens' "
- + "OR subcategory = 'Camera Tripod'"
- + "OR subcategory = 'Other'")
- .matches(not(containsUnion(true)))
- .matches(containsIndexScan("PUBLIC", "PRODUCTS",
"IDX_SUBCATEGORY"))
- .matches(containsString("searchBounds=[[MultiBounds"))
+ + "WHERE category = 'Photo' "
+ + "OR (subcat_id > 12 AND subcat_id < 22)")
+ .matches(containsUnion(true))
+ .matches(containsIndexScan("PUBLIC", "PRODUCTS",
"IDX_CATEGORY"))
+ .matches(containsIndexScan("PUBLIC", "PRODUCTS",
"IDX_SUBCAT_ID"))
+ .returns(1, "Photo", 1, "Camera Media", 11, "Media 1")
+ .returns(2, "Photo", 1, "Camera Media", 11, "Media 2")
.returns(3, "Photo", 1, "Camera Lens", 12, "Lens 1")
.returns(4, "Photo", 1, "Other", 12, "Charger 1")
- .returns(6, "Video", 2, "Camera Lens", 22, "Lens 3")
- .returns(8, null, 0, "Camera Lens", 11, "Zeiss")
+ .returns(5, "Video", 2, "Camera Media", 21, "Media 3")
.check();
}
+ /*--- "Not contains union" section. ---*/
+
/**
- * Check 'OR -> UNION' rule is applied for mixed conditions on indexed
columns.
+ * Check 'OR -> UNION' rule is NOT applied for equality conditions on the
same indexed column.
*
* @throws Exception If failed.
*/
@Test
- public void testMixedOrToUnionAllRewrite() {
+ public void testNonDistinctOrToUnionAllRewrite() {
assertQuery("SELECT * "
+ "FROM products "
- + "WHERE category = 'Photo' "
- + "OR (subcat_id > 12 AND subcat_id < 22)")
- .matches(containsUnion(true))
- .matches(containsIndexScan("PUBLIC", "PRODUCTS",
"IDX_CATEGORY"))
- .matches(containsIndexScan("PUBLIC", "PRODUCTS",
"IDX_SUBCAT_ID"))
- .returns(1, "Photo", 1, "Camera Media", 11, "Media 1")
- .returns(2, "Photo", 1, "Camera Media", 11, "Media 2")
+ + "WHERE subcategory = 'Camera Lens' "
Review Comment:
I see you rearrange test methods.
This one now has less conditions and missed bounds check
`.matches(containsString("searchBounds=[[MultiBounds"))`
Was it done intentionally?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]