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/12/16 07:20:49 UTC

[GitHub] [ignite] Berkof opened a new pull request #9663: IGNITE-16140 Cannot find data in index when querying a pojo key in local mode.

Berkof opened a new pull request #9663:
URL: https://github.com/apache/ignite/pull/9663


   [IGNITE-16140](https://issues.apache.org/jira/browse/IGNITE-16140)
   
   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] Berkof commented on a change in pull request #9663: IGNITE-16140 Cannot find data in index when querying a pojo key in local mode.

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



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
##########
@@ -592,7 +594,14 @@ private GridQueryFieldsResult executeSelectLocal(
 
                         PreparedStatement stmt = conn.prepareStatement(qry, H2StatementCache.queryFlags(qryDesc));
 
-                        H2Utils.bindParameters(stmt, args);
+                        // Convert parameters into BinaryObjects.
+                        Marshaller m = ctx.config().getMarshaller();
+                        byte[] paramsBytes = U.marshal(m, args.toArray(new Object[0]));
+                        final ClassLoader ldr = U.resolveClassLoader(ctx.config());
+                        Object[] params = BinaryUtils.rawArrayFromBinary(((BinaryMarshaller)m).binaryMarshaller()
+                            .unmarshal(paramsBytes, ldr));

Review comment:
       To use the same code everywhere we serialize query parameters. Through network or nor.




-- 
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 #9663: IGNITE-16140 Cannot find data in index when querying a pojo key in local mode.

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



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
##########
@@ -592,7 +594,14 @@ private GridQueryFieldsResult executeSelectLocal(
 

Review comment:
       On the line above you create a list of argument from an array of parameter. The only usage of this list is on the 599 line where you create an array from it. So why don't just use the original array from `qryParams.arguments()`?

##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
##########
@@ -592,7 +594,14 @@ private GridQueryFieldsResult executeSelectLocal(
 
                         PreparedStatement stmt = conn.prepareStatement(qry, H2StatementCache.queryFlags(qryDesc));
 
-                        H2Utils.bindParameters(stmt, args);
+                        // Convert parameters into BinaryObjects.
+                        Marshaller m = ctx.config().getMarshaller();
+                        byte[] paramsBytes = U.marshal(m, args.toArray(new Object[0]));
+                        final ClassLoader ldr = U.resolveClassLoader(ctx.config());
+                        Object[] params = BinaryUtils.rawArrayFromBinary(((BinaryMarshaller)m).binaryMarshaller()

Review comment:
       what if someone has its own marshaller configured?




-- 
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] Berkof commented on a change in pull request #9663: IGNITE-16140 Cannot find data in index when querying a pojo key in local mode.

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



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
##########
@@ -592,7 +594,14 @@ private GridQueryFieldsResult executeSelectLocal(
 

Review comment:
       Good point, thx.




-- 
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] AMashenkov commented on a change in pull request #9663: IGNITE-16140 Cannot find data in index when querying a pojo key in local mode.

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



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
##########
@@ -592,7 +594,14 @@ private GridQueryFieldsResult executeSelectLocal(
 
                         PreparedStatement stmt = conn.prepareStatement(qry, H2StatementCache.queryFlags(qryDesc));
 
-                        H2Utils.bindParameters(stmt, args);
+                        // Convert parameters into BinaryObjects.
+                        Marshaller m = ctx.config().getMarshaller();
+                        byte[] paramsBytes = U.marshal(m, args.toArray(new Object[0]));
+                        final ClassLoader ldr = U.resolveClassLoader(ctx.config());
+                        Object[] params = BinaryUtils.rawArrayFromBinary(((BinaryMarshaller)m).binaryMarshaller()
+                            .unmarshal(paramsBytes, ldr));

Review comment:
       Why not just marshal parameters one-by-one to BinaryObject[] ?




-- 
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 merged pull request #9663: IGNITE-16140 Cannot find data in index when querying a pojo key in local mode.

Posted by GitBox <gi...@apache.org>.
korlov42 merged pull request #9663:
URL: https://github.com/apache/ignite/pull/9663


   


-- 
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