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/11/25 10:54:00 UTC

[GitHub] [ignite] tledkov-gridgain opened a new pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

tledkov-gridgain opened a new pull request #9604:
URL: https://github.com/apache/ignite/pull/9604


   …ty key indexes from CREATE TABLE and QueryEntity
   
   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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
##########
@@ -523,6 +523,15 @@
     /** Query parallelism value of cache configuration. */
     private static final String PARAM_PARALLELISM = "PARALLELISM";
 
+    /** */
+    private static final String PARAM_PK_INLINE_SIZE = "PK_INLINE_SIZE";

Review comment:
       I think we need add some docs for this new properties in "docs/_docs/sql-reference/ddl.adoc"




-- 
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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -669,6 +687,74 @@ public QueryEntity addQueryField(String fullName, String type, String alias) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public int getPrimaryKeyInlineSize() {
+        return pkInlineSize != null ? pkInlineSize : -1;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index. Implemented at the child.
+     *
+     * @param pkInlineSize INLINE_SIZE for PK index.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setPrimaryKeyInlineSize(int pkInlineSize) {

Review comment:
       I got critical failure when I set "-2" here. Also I don't like idea when user can explicitly set "-1". For me it's something like undefined behavior. Can we restrict it with only positive values only?
   
   `[2021-12-06 11:52:17,602][ERROR][exchange-worker-#56%index.BasicIndexTest%][IgniteTestResources] Critical system error detected. Will be handled accordingly to configured handler [hnd=StopNodeFailureHandler [super=AbstractFailureHandler [ignoredFailureTypes=UnmodifiableSet [SYSTEM_WORKER_BLOCKED, SYSTEM_CRITICAL_OPERATION_TIMEOUT]]], failureCtx=FailureContext [type=SYSTEM_WORKER_TERMINATION, err=java.lang.AssertionError]]
   `




-- 
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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -669,6 +687,74 @@ public QueryEntity addQueryField(String fullName, String type, String alias) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public int getPrimaryKeyInlineSize() {
+        return pkInlineSize != null ? pkInlineSize : -1;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index. Implemented at the child.

Review comment:
       Which implementation in the child do you mean here?




-- 
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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -669,6 +687,74 @@ public QueryEntity addQueryField(String fullName, String type, String alias) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public int getPrimaryKeyInlineSize() {
+        return pkInlineSize != null ? pkInlineSize : -1;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index. Implemented at the child.
+     *
+     * @param pkInlineSize INLINE_SIZE for PK index.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setPrimaryKeyInlineSize(int pkInlineSize) {
+        this.pkInlineSize = pkInlineSize;
+
+        return this;
+    }
+
+    /**
+     * Returns INLINE_SIZE for affinity field index.
+     *
+     * @return INLINE_SIZE for affinity field index.
+     */
+    public int getAffinityFieldInlineSize() {
+        return affFieldInlineSize != null ? affFieldInlineSize : -1;
+    }
+
+    /**
+     * Sets INLINE_SIZE for AFFINITY_KEY index. Implemented at the child.
+     *
+     * @param affFieldInlineSize INLINE_SIZE for AFFINITY_KEY index.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setAffinityKeyInlineSize(int affFieldInlineSize) {
+        this.affFieldInlineSize = affFieldInlineSize;
+
+        return this;
+    }
+
+    /**
+     * The property is used for composite primary key.
+     *
+     * @return  {@code true} if the PK index is created on fields of PK;
+     * {@code false} in case the PK index is created on the whole key (composite binary object).
+     * {@code null} - compatible behavior (unwrap for a table created by SQL and wrapped key for a table created by API).
+     */
+    public Boolean getUnwrapPrimaryKeyFields() {
+        return unwrapPk;
+    }
+
+    /**
+     * The property is used for composite primary key.
+     *
+     * @param unwrapPk {@code true} if the PK index is created on fields of PK;
+     *      {@code false} in case the PK index is created on the whole key (composite binary object).

Review comment:
       Redundant tabs 




-- 
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] tledkov-gridgain commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

Posted by GitBox <gi...@apache.org>.
tledkov-gridgain commented on a change in pull request #9604:
URL: https://github.com/apache/ignite/pull/9604#discussion_r804671800



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -669,6 +687,84 @@ public QueryEntity addQueryField(String fullName, String type, String alias) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public Integer getPrimaryKeyInlineSize() {
+        return pkInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index.
+     *
+     * @param pkInlineSize INLINE_SIZE for PK index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setPrimaryKeyInlineSize(Integer pkInlineSize) {
+        if (pkInlineSize != null && pkInlineSize < 0) {
+            throw new CacheException("Inline size for sorted primary key cannot be negative. "
+                    + "[inlineSize=" + pkInlineSize + ']');
+        }
+
+        this.pkInlineSize = pkInlineSize;
+
+        return this;
+    }
+
+    /**
+     * Returns INLINE_SIZE for affinity field index.
+     *
+     * @return INLINE_SIZE for affinity field index.
+     */
+    public Integer getAffinityFieldInlineSize() {
+        return affFieldInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for AFFINITY_KEY index.
+     *
+     * @param affFieldInlineSize INLINE_SIZE for AFFINITY_KEY index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setAffinityKeyInlineSize(Integer affFieldInlineSize) {
+        if (affFieldInlineSize != null && affFieldInlineSize < 0) {
+            throw new CacheException("Inline size for affinity filed index cannot be negative. "
+                    + "[inlineSize=" + affFieldInlineSize + ']');
+        }
+
+        this.affFieldInlineSize = affFieldInlineSize;
+
+        return this;
+    }
+
+    /**
+     * The property is used for sorted index and composite primary key.
+     *
+     * @return  {@code true} if the PK index is created on fields of PK.
+     * {@code false} in case the PK index is created on the whole key (composite binary object).
+     * {@code null} - compatible behavior (unwrap for a table created by SQL and wrapped key for a table created by API).
+     */
+    public Boolean getUnwrapPrimaryKeyFieldsForSortedIndex() {

Review comment:
       I guess yes. Real _KEY object. I guess it's a matter of terminology: key / value vs table behavior.




-- 
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] tledkov-gridgain merged pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

Posted by GitBox <gi...@apache.org>.
tledkov-gridgain merged pull request #9604:
URL: https://github.com/apache/ignite/pull/9604


   


-- 
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] tledkov-gridgain commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

Posted by GitBox <gi...@apache.org>.
tledkov-gridgain commented on a change in pull request #9604:
URL: https://github.com/apache/ignite/pull/9604#discussion_r762979443



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2TableDescriptor.java
##########
@@ -325,7 +325,7 @@ GridLuceneIndex luceneIndex() {
     @NotNull private List<IndexColumn> extractKeyColumns(GridH2Table tbl, IndexColumn keyCol, IndexColumn affCol) {
         ArrayList<IndexColumn> keyCols;
 
-        if (isSql) {

Review comment:
       >  do we need H2TableDescriptor#sql() method then at all?
   I guess, yes. Because we have to support compatible behavior.
   May it will be dropped in the future.
   




-- 
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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -669,6 +687,84 @@ public QueryEntity addQueryField(String fullName, String type, String alias) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public Integer getPrimaryKeyInlineSize() {
+        return pkInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index.
+     *
+     * @param pkInlineSize INLINE_SIZE for PK index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setPrimaryKeyInlineSize(Integer pkInlineSize) {
+        if (pkInlineSize != null && pkInlineSize < 0) {
+            throw new CacheException("Inline size for sorted primary key cannot be negative. "
+                    + "[inlineSize=" + pkInlineSize + ']');
+        }
+
+        this.pkInlineSize = pkInlineSize;
+
+        return this;
+    }
+
+    /**
+     * Returns INLINE_SIZE for affinity field index.
+     *
+     * @return INLINE_SIZE for affinity field index.
+     */
+    public Integer getAffinityFieldInlineSize() {
+        return affFieldInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for AFFINITY_KEY index.
+     *
+     * @param affFieldInlineSize INLINE_SIZE for AFFINITY_KEY index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setAffinityKeyInlineSize(Integer affFieldInlineSize) {
+        if (affFieldInlineSize != null && affFieldInlineSize < 0) {
+            throw new CacheException("Inline size for affinity filed index cannot be negative. "
+                    + "[inlineSize=" + affFieldInlineSize + ']');
+        }
+
+        this.affFieldInlineSize = affFieldInlineSize;
+
+        return this;
+    }
+
+    /**
+     * The property is used for sorted index and composite primary key.
+     *
+     * @return  {@code true} if the PK index is created on fields of PK.
+     * {@code false} in case the PK index is created on the whole key (composite binary object).
+     * {@code null} - compatible behavior (unwrap for a table created by SQL and wrapped key for a table created by API).
+     */
+    public Boolean getUnwrapPrimaryKeyFieldsForSortedIndex() {

Review comment:
       Do we have non-sorted primary key index?




-- 
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] tledkov-gridgain commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

Posted by GitBox <gi...@apache.org>.
tledkov-gridgain commented on a change in pull request #9604:
URL: https://github.com/apache/ignite/pull/9604#discussion_r804671800



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -669,6 +687,84 @@ public QueryEntity addQueryField(String fullName, String type, String alias) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public Integer getPrimaryKeyInlineSize() {
+        return pkInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index.
+     *
+     * @param pkInlineSize INLINE_SIZE for PK index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setPrimaryKeyInlineSize(Integer pkInlineSize) {
+        if (pkInlineSize != null && pkInlineSize < 0) {
+            throw new CacheException("Inline size for sorted primary key cannot be negative. "
+                    + "[inlineSize=" + pkInlineSize + ']');
+        }
+
+        this.pkInlineSize = pkInlineSize;
+
+        return this;
+    }
+
+    /**
+     * Returns INLINE_SIZE for affinity field index.
+     *
+     * @return INLINE_SIZE for affinity field index.
+     */
+    public Integer getAffinityFieldInlineSize() {
+        return affFieldInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for AFFINITY_KEY index.
+     *
+     * @param affFieldInlineSize INLINE_SIZE for AFFINITY_KEY index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setAffinityKeyInlineSize(Integer affFieldInlineSize) {
+        if (affFieldInlineSize != null && affFieldInlineSize < 0) {
+            throw new CacheException("Inline size for affinity filed index cannot be negative. "
+                    + "[inlineSize=" + affFieldInlineSize + ']');
+        }
+
+        this.affFieldInlineSize = affFieldInlineSize;
+
+        return this;
+    }
+
+    /**
+     * The property is used for sorted index and composite primary key.
+     *
+     * @return  {@code true} if the PK index is created on fields of PK.
+     * {@code false} in case the PK index is created on the whole key (composite binary object).
+     * {@code null} - compatible behavior (unwrap for a table created by SQL and wrapped key for a table created by API).
+     */
+    public Boolean getUnwrapPrimaryKeyFieldsForSortedIndex() {

Review comment:
       I guess yes. Real _KEY object. I guess it's a matter of terminology: key / value vs table behavior.
   Sorted PK index doesn't affect real PK constraint behavior.




-- 
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] tledkov-gridgain commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

Posted by GitBox <gi...@apache.org>.
tledkov-gridgain commented on a change in pull request #9604:
URL: https://github.com/apache/ignite/pull/9604#discussion_r762979443



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2TableDescriptor.java
##########
@@ -325,7 +325,7 @@ GridLuceneIndex luceneIndex() {
     @NotNull private List<IndexColumn> extractKeyColumns(GridH2Table tbl, IndexColumn keyCol, IndexColumn affCol) {
         ArrayList<IndexColumn> keyCols;
 
-        if (isSql) {

Review comment:
       >  do we need H2TableDescriptor#sql() method then at all?
   
   I guess, yes. Because we have to support compatible behavior.
   May it will be dropped in the future.
   




-- 
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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2TableDescriptor.java
##########
@@ -325,7 +325,7 @@ GridLuceneIndex luceneIndex() {
     @NotNull private List<IndexColumn> extractKeyColumns(GridH2Table tbl, IndexColumn keyCol, IndexColumn affCol) {
         ArrayList<IndexColumn> keyCols;
 
-        if (isSql) {

Review comment:
       But `H2TableDescriptor#sql()` is never used now and is in internal package. Is it used somehow for compatibility?




-- 
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] tledkov-gridgain commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

Posted by GitBox <gi...@apache.org>.
tledkov-gridgain commented on a change in pull request #9604:
URL: https://github.com/apache/ignite/pull/9604#discussion_r804669193



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryEntityEx.java
##########
@@ -90,6 +99,58 @@ public QueryEntity setPreserveKeysOrder(boolean preserveKeysOrder) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public Integer getPrimaryKeyInlineSize() {
+        return pkInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index.
+     *
+     * @param pkInlineSize INLINE_SIZE for PK index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setPrimaryKeyInlineSize(Integer pkInlineSize) {
+        if (pkInlineSize != null && pkInlineSize < 0) {
+            throw new CacheException("Inline size for sorted primary key cannot be negative. "
+                + "[inlineSize=" + pkInlineSize + ']');
+        }
+
+        this.pkInlineSize = pkInlineSize;
+
+        return this;
+    }
+
+    /**
+     * Returns INLINE_SIZE for affinity field index.
+     *
+     * @return INLINE_SIZE for affinity field index.
+     */
+    public Integer getAffinityFieldInlineSize() {
+        return affFieldInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for AFFINITY_KEY index.
+     *
+     * @param affFieldInlineSize INLINE_SIZE for AFFINITY_KEY index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setAffinityKeyInlineSize(Integer affFieldInlineSize) {

Review comment:
       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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2TableDescriptor.java
##########
@@ -325,7 +325,7 @@ GridLuceneIndex luceneIndex() {
     @NotNull private List<IndexColumn> extractKeyColumns(GridH2Table tbl, IndexColumn keyCol, IndexColumn affCol) {
         ArrayList<IndexColumn> keyCols;
 
-        if (isSql) {

Review comment:
       Hi! `H2TableDescriptor#sql()` also is used in `H2Utils#unwrapKeyColumns` for indexes information. Should we change logic there too?




-- 
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] tledkov-gridgain commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

Posted by GitBox <gi...@apache.org>.
tledkov-gridgain commented on a change in pull request #9604:
URL: https://github.com/apache/ignite/pull/9604#discussion_r762982502



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -669,6 +687,74 @@ public QueryEntity addQueryField(String fullName, String type, String alias) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public int getPrimaryKeyInlineSize() {
+        return pkInlineSize != null ? pkInlineSize : -1;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index. Implemented at the child.
+     *
+     * @param pkInlineSize INLINE_SIZE for PK index.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setPrimaryKeyInlineSize(int pkInlineSize) {

Review comment:
       Great issue. 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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryEntityEx.java
##########
@@ -90,6 +99,58 @@ public QueryEntity setPreserveKeysOrder(boolean preserveKeysOrder) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public Integer getPrimaryKeyInlineSize() {
+        return pkInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index.
+     *
+     * @param pkInlineSize INLINE_SIZE for PK index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setPrimaryKeyInlineSize(Integer pkInlineSize) {
+        if (pkInlineSize != null && pkInlineSize < 0) {
+            throw new CacheException("Inline size for sorted primary key cannot be negative. "
+                + "[inlineSize=" + pkInlineSize + ']');
+        }
+
+        this.pkInlineSize = pkInlineSize;
+
+        return this;
+    }
+
+    /**
+     * Returns INLINE_SIZE for affinity field index.
+     *
+     * @return INLINE_SIZE for affinity field index.
+     */
+    public Integer getAffinityFieldInlineSize() {
+        return affFieldInlineSize;
+    }
+
+    /**
+     * Sets INLINE_SIZE for AFFINITY_KEY index.
+     *
+     * @param affFieldInlineSize INLINE_SIZE for AFFINITY_KEY index, when {@code null} - inline size is calculated automativally.
+     * @return {@code this} for chaining.
+     */
+    public QueryEntity setAffinityKeyInlineSize(Integer affFieldInlineSize) {

Review comment:
       Hi, here it is "affinityKey", while getter is "affinityField".




-- 
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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2TableDescriptor.java
##########
@@ -325,7 +325,7 @@ GridLuceneIndex luceneIndex() {
     @NotNull private List<IndexColumn> extractKeyColumns(GridH2Table tbl, IndexColumn keyCol, IndexColumn affCol) {
         ArrayList<IndexColumn> keyCols;
 
-        if (isSql) {

Review comment:
       I see this change, do we need `H2TableDescriptor#sql()` method then at all? 




-- 
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] tledkov-gridgain commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

Posted by GitBox <gi...@apache.org>.
tledkov-gridgain commented on a change in pull request #9604:
URL: https://github.com/apache/ignite/pull/9604#discussion_r762980644



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -669,6 +687,74 @@ public QueryEntity addQueryField(String fullName, String type, String alias) {
         return this;
     }
 
+    /**
+     * Returns INLINE_SIZE for PK index.
+     *
+     * @return INLINE_SIZE for PK index.
+     */
+    public int getPrimaryKeyInlineSize() {
+        return pkInlineSize != null ? pkInlineSize : -1;
+    }
+
+    /**
+     * Sets INLINE_SIZE for PK index. Implemented at the child.

Review comment:
       It's a mistake. 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] timoninmaxim commented on a change in pull request #9604: IGNITE-11402 SQL: Add ability to specify inline size of PK and affini…

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



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
##########
@@ -103,6 +103,20 @@
     /** Scale for fields. */
     private Map<String, Integer> fieldsScale = new HashMap<>();
 
+    /**
+     * Used for composite primary key.
+     * {@code true} if the PK index is created on fields of PK;

Review comment:
       Let's use the same sign fin the end of every line for public docs: "." instead ";".




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