ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgenii Zhuravlev (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (IGNITE-11373) varchar_ignorecase doesn't work properly
Date Wed, 27 Feb 2019 02:20:00 GMT

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

Evgenii Zhuravlev edited comment on IGNITE-11373 at 2/27/19 2:19 AM:
---------------------------------------------------------------------

I did the analysis of this issue and added an additional flag for the H2 connection string(org.apache.ignite.internal.processors.query.h2.ConnectionManager#DB_OPTIONS):
IGNORECASE=TRUE; 

It started to work, however, after adding an index on this field, it starts to fail in 2 places
on the field type validation: InlineIndexHelper:
On creating the index:
     if (this.type != type)
            throw new UnsupportedOperationException("Invalid fast index type: " + type);
And on reading:
        if (val.getType() != type)
            throw new UnsupportedOperationException("value type doesn't match");

After commenting these lines, looks like everything started to work. I see that it works much
faster than without index. So, looks like it something that could be fixed pretty fast, we
just need to figure out how to change this type check.

Here is the updated code for the reproducer with index
{code:java}
  Ignite ignite = Ignition.start("examples/config/example-ignite.xml");

        IgniteCache cache = ignite.getOrCreateCache("TEST");

        cache.query(new SqlFieldsQuery("CREATE TABLE IF NOT EXISTS TEST\n" +
            "(\n" +
            "  TEST_ID                NUMBER(15)        NOT NULL,\n" +
            "  TEST_VALUE             VARCHAR_IGNORECASE(100),\n" +
            "  PRIMARY KEY (TEST_ID)\n" +
            ") "));


        cache.query(new SqlFieldsQuery("CREATE INDEX value_idx ON TEST (TEST_VALUE);"));

        for (int i = 0; i < 100000; i++)
            System.out.println("INSERTED: " + i + " - " + ignite.cache("TEST").query(new SqlFieldsQuery("INSERT
INTO TEST values (" + i + " , '" + (i  == 50000 ? "" : i) + "aAa')")).getAll().size());

        for (int i = 0; i < 1000; i++) {
            StopWatch sw = new StopWatch();
            sw.start();
                System.out.println("FOUND:" + ignite.cache("TEST").query(new SqlFieldsQuery("Select
* from TEST where TEST_VALUE = 'aaa'")).getAll().size());
            sw.stop();
            System.out.println("Time: " + sw.getTotalTimeMillis());
        }
{code}



was (Author: ezhuravl):
I did the analysis of this issue and added an additional flag for the H2 connection string(org.apache.ignite.internal.processors.query.h2.ConnectionManager#DB_OPTIONS):
IGNORECASE=TRUE; 

It started to work, however, after adding an index on this field, it starts to fail in 2 places
on the field type validation: InlineIndexHelper:
On creating the index:
     if (this.type != type)
            throw new UnsupportedOperationException("Invalid fast index type: " + type);
And on reading:
        if (val.getType() != type)
            throw new UnsupportedOperationException("value type doesn't match");

After commenting these lines, looks like everything started to work. I see that it works much
faster than without index. So, looks like it something that could be fixed pretty fast, we
just need to figure out how to change this type check.


> varchar_ignorecase doesn't work properly
> ----------------------------------------
>
>                 Key: IGNITE-11373
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11373
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Evgenii Zhuravlev
>            Priority: Major
>
> Looks like a field with type varchar_ignorecase can't be used for filtering the values
for different cases.
> {code:java}
> Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
>         
>         IgniteCache cache = ignite.getOrCreateCache("TEST");
>         cache.query(new SqlFieldsQuery("CREATE TABLE IF NOT EXISTS TEST\n" +
>             "(\n" +
>             "  TEST_ID                NUMBER(15)        NOT NULL,\n" +
>             "  TEST_VALUE             VARCHAR_IGNORECASE(100),\n" +
>             "  PRIMARY KEY (TEST_ID)\n" +
>             ") "));
>         System.out.println("INSERTED:" + ignite.cache("TEST").query(new SqlFieldsQuery("INSERT
INTO TEST values (1,'aAa')")).getAll().size());
>         System.out.println("FOUND:" + ignite.cache("TEST").query(new SqlFieldsQuery("Select
* from TEST where TEST_VALUE like '%aaa%'")).getAll().size());
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message