You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/09/15 11:51:15 UTC

[GitHub] [ignite] zstan opened a new pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

zstan opened a new pull request #9410:
URL: https://github.com/apache/ignite/pull/9410


   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] korlov42 commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
korlov42 commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710197000



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -76,11 +81,29 @@
     /** Script. */
     private Script script;
 
+    /** nl to bytes representation. */
+    private static final byte[] NL_BYTES = "\n".getBytes();
+
+    /** Eqivalent results store. */
+    private Map<String, Collection<String>> eqResStorage = new HashMap<>();
+
+    /** Hash algo. */
+    MessageDigest messageDigest;
+
     /** */
     public SqlScriptRunner(Path test, QueryEngine engine, IgniteLogger log) {
         this.test = test;
         this.engine = engine;
         this.log = log;
+
+        try {
+            messageDigest = MessageDigest.getInstance("MD5");
+        }
+        catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();

Review comment:
       stack trace will be available in re-thrown exception




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] zstan commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
zstan commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710249676



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -595,6 +673,14 @@ private void checkResultsHashed(List<List<?>> res) {
         }
     }
 
+    /** */
+    public static String byteArrayToHex(byte[] arr) {

Review comment:
       it converts to upper case, ok i extend utility method, thanks.




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] korlov42 commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
korlov42 commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710162600



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -585,8 +637,34 @@ private void checkEquals(String msg, String expectedStr, Object actual) {
 
         /** */
         private void checkResultsHashed(List<List<?>> res) {
-            // TODO:
-            throw new UnsupportedOperationException("Hashed results compare not supported");
+            Objects.requireNonNull(res, "empty result set");
+
+            messageDigest.reset();
+
+            for (List<?> l : res) {

Review comment:
       it's better to name it `row` and `col`




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] zstan closed pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
zstan closed pull request #9410:
URL: https://github.com/apache/ignite/pull/9410


   


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] korlov42 commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
korlov42 commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710195641



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -76,11 +81,29 @@
     /** Script. */
     private Script script;
 
+    /** nl to bytes representation. */
+    private static final byte[] NL_BYTES = "\n".getBytes();

Review comment:
       U.nl()




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] ivandasch commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
ivandasch commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710261229



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -76,11 +81,29 @@
     /** Script. */
     private Script script;
 
+    /** nl to bytes representation. */
+    private static final byte[] NL_BYTES = "\n".getBytes();

Review comment:
       ```
   byte[] test = {10};
   ```
   ![image](https://user-images.githubusercontent.com/6059537/133646670-aa4974d6-d2bb-4387-ac36-998124af9387.png)
   




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] korlov42 commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
korlov42 commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710160624



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -607,4 +693,11 @@ private void checkResultsHashed(List<List<?>> res) {
         T,
         R
     }
+
+    /** */
+    private enum SortType {
+        ROWSORT,

Review comment:
       let's provide description for this sort types




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] ivandasch commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
ivandasch commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710261229



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -76,11 +81,29 @@
     /** Script. */
     private Script script;
 
+    /** nl to bytes representation. */
+    private static final byte[] NL_BYTES = "\n".getBytes();

Review comment:
       ```
   byte[] NL_BYTES = {10};
   ```
   ![image](https://user-images.githubusercontent.com/6059537/133646670-aa4974d6-d2bb-4387-ac36-998124af9387.png)
   




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] zstan commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
zstan commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710204556



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -76,11 +81,29 @@
     /** Script. */
     private Script script;
 
+    /** nl to bytes representation. */
+    private static final byte[] NL_BYTES = "\n".getBytes();

Review comment:
       yes but ... no :) this constant hardly used in corresponding hash calculation.




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] korlov42 commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
korlov42 commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710197000



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -76,11 +81,29 @@
     /** Script. */
     private Script script;
 
+    /** nl to bytes representation. */
+    private static final byte[] NL_BYTES = "\n".getBytes();
+
+    /** Eqivalent results store. */
+    private Map<String, Collection<String>> eqResStorage = new HashMap<>();
+
+    /** Hash algo. */
+    MessageDigest messageDigest;
+
     /** */
     public SqlScriptRunner(Path test, QueryEngine engine, IgniteLogger log) {
         this.test = test;
         this.engine = engine;
         this.log = log;
+
+        try {
+            messageDigest = MessageDigest.getInstance("MD5");
+        }
+        catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();

Review comment:
       stack trace will be available in re-threw exception




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] korlov42 commented on a change in pull request #9410: IGNITE-15512 Append additional tests into ScriptTestSuite

Posted by GitBox <gi...@apache.org>.
korlov42 commented on a change in pull request #9410:
URL: https://github.com/apache/ignite/pull/9410#discussion_r710160926



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/logical/SqlScriptRunner.java
##########
@@ -595,6 +673,14 @@ private void checkResultsHashed(List<List<?>> res) {
         }
     }
 
+    /** */
+    public static String byteArrayToHex(byte[] arr) {

Review comment:
       IgniteUtils.byteArray2HexString()




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org