timoninmaxim commented on a change in pull request #9139:
URL: https://github.com/apache/ignite/pull/9139#discussion_r644551636
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java
##########
@@ -55,15 +52,15 @@ public void
testSecondaryIndexWithIntersectColumnsComplexPk() {
executeSql("CREATE INDEX ON " + tblName + "(id, name, city)");
- checkUsingIndexes(tblName, "'1'");
+ checkUsingIndexes(tblName, "'1'", 2, "Query should be splitted");
}
/**
* Test using secondary index with simple PK.
*/
@Test
public void testSecondaryIndexSimplePk() {
- HashMap<String, String> types = new HashMap() {
+ Map<String, String> types = new LinkedHashMap<String, String>() {
Review comment:
What is a purpose of this change?
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java
##########
@@ -97,7 +94,7 @@ public void testSecondaryIndexSimplePk() {
executeSql("CREATE INDEX ON " + tblName + "(id, name, city)");
- checkUsingIndexes(tblName, val);
+ checkUsingIndexes(tblName, val, 1, "Query with type column: " +
type);
Review comment:
Can we use the same label as for other test, like "Query shouldn't be
splitted"?
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java
##########
@@ -106,30 +103,34 @@ public void testSecondaryIndexSimplePk() {
*
* @param tblName name of table which should be checked to using secondary
indexes.
* @param nameVal Value for name param.
+ * @param expResCnt Expceted result count.
+ * @param assertLabel Assert label.
*/
- private void checkUsingIndexes(String tblName, String nameVal) {
+ private void checkUsingIndexes(String tblName, String nameVal, int
expResCnt, String assertLabel) {
String explainSQL = "explain SELECT * FROM " + tblName + " WHERE ";
List<List<?>> results = executeSql(explainSQL + "id=1");
- assertUsingSecondaryIndex(results);
+ assertUsingSecondaryIndex(results, 2, assertLabel); // always
merge_scan for non key (or affinity) fields condition
Review comment:
Please check rules how comments should be formatted there:
https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-JavadocComments
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java
##########
@@ -106,30 +103,34 @@ public void testSecondaryIndexSimplePk() {
*
* @param tblName name of table which should be checked to using secondary
indexes.
* @param nameVal Value for name param.
+ * @param expResCnt Expceted result count.
+ * @param assertLabel Assert label.
*/
- private void checkUsingIndexes(String tblName, String nameVal) {
+ private void checkUsingIndexes(String tblName, String nameVal, int
expResCnt, String assertLabel) {
Review comment:
assertLabel has to be replaced with abbreviation. Please check [1]. It
can be configured for IDE.
[1] https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java
##########
@@ -106,30 +103,34 @@ public void testSecondaryIndexSimplePk() {
*
* @param tblName name of table which should be checked to using secondary
indexes.
* @param nameVal Value for name param.
+ * @param expResCnt Expceted result count.
+ * @param assertLabel Assert label.
*/
- private void checkUsingIndexes(String tblName, String nameVal) {
+ private void checkUsingIndexes(String tblName, String nameVal, int
expResCnt, String assertLabel) {
String explainSQL = "explain SELECT * FROM " + tblName + " WHERE ";
List<List<?>> results = executeSql(explainSQL + "id=1");
- assertUsingSecondaryIndex(results);
+ assertUsingSecondaryIndex(results, 2, assertLabel); // always
merge_scan for non key (or affinity) fields condition
results = executeSql(explainSQL + "id=1 and name=" + nameVal);
- assertUsingSecondaryIndex(results);
+ assertUsingSecondaryIndex(results, expResCnt, assertLabel);
results = executeSql(explainSQL + "id=1 and name=" + nameVal + " and
age=0");
- assertUsingSecondaryIndex(results);
+ assertUsingSecondaryIndex(results, expResCnt, assertLabel);
}
/**
* Check that explain plan result shown using Secondary index and don't
use scan.
*
* @param results result of execut explain plan query.
+ * @param expResCnt Expceted result count.
+ * @param assertLabel Assert label.
*/
- private void assertUsingSecondaryIndex(List<List<?>> results) {
- assertEquals(2, results.size());
+ private void assertUsingSecondaryIndex(List<List<?>> results, int
expResCnt, String assertLabel) {
Review comment:
USe abbr for assertLabel.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]