You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Ozerov (JIRA)" <ji...@apache.org> on 2017/06/01 08:13:04 UTC

[jira] [Comment Edited] (IGNITE-5361) SQL: naive handling of fixed length CHAR columns

    [ https://issues.apache.org/jira/browse/IGNITE-5361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16032619#comment-16032619 ] 

Vladimir Ozerov edited comment on IGNITE-5361 at 6/1/17 8:12 AM:
-----------------------------------------------------------------

[~al.psc], [~agura], QueryEntity is going to be deprecated in favor of new SQL API which is yet to be designed [1]. Having said that, please do not plan any changes to {{QueryEntity}} as it is already overly complex. For now there is a simple workaround - use {{TRIM}} or {{PAD}} SQL functions depending on what is needed.

[1] https://issues.apache.org/jira/browse/IGNITE-4701


was (Author: vozerov):
[~al.psc], [~agura], QueryEntity is going to be deprecated in favor of new SQL API which is yet to be designed [1]. Having said that, please do not plan any changes to {{QueryEntity}} as it is already overly complex. For now there is a simple workaround for this - use {{TRIM}} or {{PAD}} SQL functions depending on what is needed.

[1] https://issues.apache.org/jira/browse/IGNITE-4701

> SQL: naive handling of fixed length CHAR columns
> ------------------------------------------------
>
>                 Key: IGNITE-5361
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5361
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 1.7
>            Reporter: Andrey Gura
>
> Use case:
> There is database where primary key has type {{CHAR(N)}} (not {{VARCHAR}}). In this case string that have length less than {{N}} will be spaces padded.
> Data has loaded into Ignite cache using {{CacheJdbcPojoStore}}. As result string field contains trailing spaces. The following SQL query wont retrieve expected value in case when string parameter doesn't contain trailing spaces: 
> {noformat}
> select * from MyTable where id = 'some_value_without_trailing spaces'
> {noformat}
> Moreover, if {{readThrough}} is enabled, and {{cache.get()}} operation will be invoked, and string identifier in key contains the same value without trailing spaces the entry will be loaded from underlying database. As result cache will contain two values with differents keys (one of them with trailing spaces while other without trailing spaces).
> Looks like usability bug.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)