Index not getting created

classic Classic list List threaded Threaded
8 messages Options
Naveen Naveen
Reply | Threaded
Open this post in threaded view
|

Index not getting created

AM using 2.3

What could be the issue with below create index command.

: jdbc:ignite:thin://127.0.0.1>  select * from "Customer".CUSTOMER
where ACCOUNT_ID_LIST ='A100000001';
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+-------------------------------+
|        ACCOUNT_ID_LIST         |      CUST_ADDRESS_ID_LIST      |
       PARTYROLE            |       PARTY_STATUS_CODE        |
  REFREE_ID           |
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+-------------------------------+
| A100000001                     | custAddressIdList1             |
partyrole1                     | partyStatusCode1               |
refreeId1                     |
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+-------------------------------+
1 row selected (3.324 seconds)
0: jdbc:ignite:thin://127.0.0.1>  select ACCOUNT_ID_LIST from
"Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';
+--------------------------------+
|        ACCOUNT_ID_LIST         |
+--------------------------------+
| A100000001                     |
+--------------------------------+
1 row selected (2.078 seconds)
0: jdbc:ignite:thin://127.0.0.1> CREATE INDEX idx_customer_accountId
ON "Customer".CUSTOMER (ACCOUNT_ID_LIST);
Error: Cache doesn't exist: Customer (state=50000,code=0)
java.sql.SQLException: Cache doesn't exist: Customer
        at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:671)
        at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)
        at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:299)
        at sqlline.Commands.execute(Commands.java:823)
        at sqlline.Commands.sql(Commands.java:733)
        at sqlline.SqlLine.dispatch(SqlLine.java:795)
        at sqlline.SqlLine.begin(SqlLine.java:668)
        at sqlline.SqlLine.start(SqlLine.java:373)
        at sqlline.SqlLine.main(SqlLine.java:265)
0: jdbc:ignite:thin://127.0.0.1>

--
Thanks & Regards,
Naveen Bandaru
Naveen Naveen
Reply | Threaded
Open this post in threaded view
|

Re: Index not getting created

Has anyone got a chance to look into into this issue where I am trying to
create an index, but its throwing an error saying cache does not exist

0: jdbc:ignite:thin://127.0.0.1>  select ACCOUNT_ID_LIST from
"Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';
+--------------------------------+
|        ACCOUNT_ID_LIST         |
+--------------------------------+
| A100000001                     |
+--------------------------------+
1 row selected (2.078 seconds)

**0: jdbc:ignite:thin://127.0.0.1> CREATE INDEX idx_customer_accountId ON
"Customer".CUSTOMER (ACCOUNT_ID_LIST);*
*Error: Cache doesn't exist: Customer (state=50000,code=0)
java.sql.SQLException: Cache doesn't exist: Customer
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:671)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:299)
        at sqlline.Commands.execute(Commands.java:823)
        at sqlline.Commands.sql(Commands.java:733)
        at sqlline.SqlLine.dispatch(SqlLine.java:795)
        at sqlline.SqlLine.begin(SqlLine.java:668)
        at sqlline.SqlLine.start(SqlLine.java:373)
        at sqlline.SqlLine.main(SqlLine.java:265)
0: jdbc:ignite:thin://127.0.0.1>




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Alexey Kukushkin Alexey Kukushkin
Reply | Threaded
Open this post in threaded view
|

Re: Index not getting created

Naveen,

Your "CREATE INDEX" syntax seems valid to me. Can you start server nodes with debugging enabled, reproduce the problem and share the debug log output from the servers?
Taras Ledkov Taras Ledkov
Reply | Threaded
Open this post in threaded view
|

Re: Index not getting created

In reply to this post by Naveen
Hi,

I cannot reproduce the issue with described steps.
Please check that the cache wasn't destroyed on the server.

i.e. please execute SELECT query again after failed CREATE INDEX.


On 30.11.2017 11:45, Naveen wrote:

> Has anyone got a chance to look into into this issue where I am trying to
> create an index, but its throwing an error saying cache does not exist
>
> 0: jdbc:ignite:thin://127.0.0.1>  select ACCOUNT_ID_LIST from
> "Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';
> +--------------------------------+
> |        ACCOUNT_ID_LIST         |
> +--------------------------------+
> | A100000001                     |
> +--------------------------------+
> 1 row selected (2.078 seconds)
>
> **0: jdbc:ignite:thin://127.0.0.1> CREATE INDEX idx_customer_accountId ON
> "Customer".CUSTOMER (ACCOUNT_ID_LIST);*
> *Error: Cache doesn't exist: Customer (state=50000,code=0)
> java.sql.SQLException: Cache doesn't exist: Customer
>          at
> org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:671)
>          at
> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)
>          at
> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:299)
>          at sqlline.Commands.execute(Commands.java:823)
>          at sqlline.Commands.sql(Commands.java:733)
>          at sqlline.SqlLine.dispatch(SqlLine.java:795)
>          at sqlline.SqlLine.begin(SqlLine.java:668)
>          at sqlline.SqlLine.start(SqlLine.java:373)
>          at sqlline.SqlLine.main(SqlLine.java:265)
> 0: jdbc:ignite:thin://127.0.0.1>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/

--
Taras Ledkov
Mail-To: [hidden email]

Naveen Naveen
Reply | Threaded
Open this post in threaded view
|

Re: Index not getting created

Hi


Here is the node logs captured with -v option.


[22:56:41,291][SEVERE][client-connector-#618%IgnitePOC%][JdbcRequestHandler]
Failed to execute SQL query [reqId=0, req=JdbcQueryExecuteRequest
[schemaName=PUBLIC, pageSize=1024, maxRows=0, sqlQry=CREATE INDEX
idx_customer_accountId ON "Customer".CUSTOMER (ACCOUNT_ID_LIST),
args=[], stmtType=ANY_STATEMENT_TYPE]]

class org.apache.ignite.internal.processors.query.IgniteSQLException:
Cache doesn't exist: Customer

        at org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.convert(DdlStatementsProcessor.java:343)

        at org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.runDdlStatement(DdlStatementsProcessor.java:287)

        at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1466)

        at org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1966)

        at org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1962)

        at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)

        at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2445)

        at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFieldsNoCache(GridQueryProcessor.java:1971)

        at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:305)

        at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:164)

        at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:137)

        at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:39)

        at org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)

        at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)

        at org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)

        at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)

        at org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

        at java.lang.Thread.run(Thread.java:748)



Select query works fine

0: jdbc:ignite:thin://127.0.0.1> select ACCOUNT_ID_LIST from
"Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';

+--------------------------------+

|        ACCOUNT_ID_LIST         |

+--------------------------------+

| A100000001                     |

+--------------------------------+

1 row selected (1.342 seconds)


Create index query failed with the below error

0: jdbc:ignite:thin://127.0.0.1> CREATE INDEX idx_customer_accountId
ON "Customer".CUSTOMER (ACCOUNT_ID_LIST);

Error: Cache doesn't exist: Customer (state=50000,code=0)

java.sql.SQLException: Cache doesn't exist: Customer

        at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:671)

        at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)

        at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:299)

        at sqlline.Commands.execute(Commands.java:823)

        at sqlline.Commands.sql(Commands.java:733)

        at sqlline.SqlLine.dispatch(SqlLine.java:795)

        at sqlline.SqlLine.begin(SqlLine.java:668)

        at sqlline.SqlLine.start(SqlLine.java:373)

        at sqlline.SqlLine.main(SqlLine.java:265)


selectc query works fine even after issuing the create index query
which is failed

0: jdbc:ignite:thin://127.0.0.1> select ACCOUNT_ID_LIST from
"Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';

+--------------------------------+

|        ACCOUNT_ID_LIST         |

+--------------------------------+

| A100000001                     |

+--------------------------------+

1 row selected (1.641 seconds)

0: jdbc:ignite:thin://127.0.0.1>

On Thu, Nov 30, 2017 at 9:04 PM, Taras Ledkov <[hidden email]> wrote:

> Hi,
>
> I cannot reproduce the issue with described steps.
> Please check that the cache wasn't destroyed on the server.
>
> i.e. please execute SELECT query again after failed CREATE INDEX.
>
>
>
> On 30.11.2017 11:45, Naveen wrote:
>>
>> Has anyone got a chance to look into into this issue where I am trying to
>> create an index, but its throwing an error saying cache does not exist
>>
>> 0: jdbc:ignite:thin://127.0.0.1>  select ACCOUNT_ID_LIST from
>> "Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';
>> +--------------------------------+
>> |        ACCOUNT_ID_LIST         |
>> +--------------------------------+
>> | A100000001                     |
>> +--------------------------------+
>> 1 row selected (2.078 seconds)
>>
>> **0: jdbc:ignite:thin://127.0.0.1> CREATE INDEX idx_customer_accountId ON
>> "Customer".CUSTOMER (ACCOUNT_ID_LIST);*
>> *Error: Cache doesn't exist: Customer (state=50000,code=0)
>> java.sql.SQLException: Cache doesn't exist: Customer
>>          at
>>
>> org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:671)
>>          at
>>
>> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)
>>          at
>>
>> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:299)
>>          at sqlline.Commands.execute(Commands.java:823)
>>          at sqlline.Commands.sql(Commands.java:733)
>>          at sqlline.SqlLine.dispatch(SqlLine.java:795)
>>          at sqlline.SqlLine.begin(SqlLine.java:668)
>>          at sqlline.SqlLine.start(SqlLine.java:373)
>>          at sqlline.SqlLine.main(SqlLine.java:265)
>> 0: jdbc:ignite:thin://127.0.0.1>
>>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
>
> --
> Taras Ledkov
> Mail-To: [hidden email]
>



--
Thanks & Regards,
Naveen Bandaru
Taras Ledkov Taras Ledkov
Reply | Threaded
Open this post in threaded view
|

Re: Index not getting created

Hi,

I see only that "cache not found" at the server.log. Something is wrong.

Is it possible to provide a test as the standalone java class or standalone
GitHub project so that I can run it and reproduce the problem?

On 30.11.2017 20:34, Naveen Kumar wrote:

> Hi
>
>
> Here is the node logs captured with -v option.
>
>
> [22:56:41,291][SEVERE][client-connector-#618%IgnitePOC%][JdbcRequestHandler]
> Failed to execute SQL query [reqId=0, req=JdbcQueryExecuteRequest
> [schemaName=PUBLIC, pageSize=1024, maxRows=0, sqlQry=CREATE INDEX
> idx_customer_accountId ON "Customer".CUSTOMER (ACCOUNT_ID_LIST),
> args=[], stmtType=ANY_STATEMENT_TYPE]]
>
> class org.apache.ignite.internal.processors.query.IgniteSQLException:
> Cache doesn't exist: Customer
>
>          at org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.convert(DdlStatementsProcessor.java:343)
>
>          at org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.runDdlStatement(DdlStatementsProcessor.java:287)
>
>          at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1466)
>
>          at org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1966)
>
>          at org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1962)
>
>          at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
>
>          at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2445)
>
>          at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFieldsNoCache(GridQueryProcessor.java:1971)
>
>          at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:305)
>
>          at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:164)
>
>          at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:137)
>
>          at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:39)
>
>          at org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
>
>          at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
>
>          at org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
>
>          at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
>
>          at org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
>
>          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>
>          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>
>          at java.lang.Thread.run(Thread.java:748)
>
>
>
> Select query works fine
>
> 0: jdbc:ignite:thin://127.0.0.1> select ACCOUNT_ID_LIST from
> "Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';
>
> +--------------------------------+
>
> |        ACCOUNT_ID_LIST         |
>
> +--------------------------------+
>
> | A100000001                     |
>
> +--------------------------------+
>
> 1 row selected (1.342 seconds)
>
>
> Create index query failed with the below error
>
> 0: jdbc:ignite:thin://127.0.0.1> CREATE INDEX idx_customer_accountId
> ON "Customer".CUSTOMER (ACCOUNT_ID_LIST);
>
> Error: Cache doesn't exist: Customer (state=50000,code=0)
>
> java.sql.SQLException: Cache doesn't exist: Customer
>
>          at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:671)
>
>          at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)
>
>          at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:299)
>
>          at sqlline.Commands.execute(Commands.java:823)
>
>          at sqlline.Commands.sql(Commands.java:733)
>
>          at sqlline.SqlLine.dispatch(SqlLine.java:795)
>
>          at sqlline.SqlLine.begin(SqlLine.java:668)
>
>          at sqlline.SqlLine.start(SqlLine.java:373)
>
>          at sqlline.SqlLine.main(SqlLine.java:265)
>
>
> selectc query works fine even after issuing the create index query
> which is failed
>
> 0: jdbc:ignite:thin://127.0.0.1> select ACCOUNT_ID_LIST from
> "Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';
>
> +--------------------------------+
>
> |        ACCOUNT_ID_LIST         |
>
> +--------------------------------+
>
> | A100000001                     |
>
> +--------------------------------+
>
> 1 row selected (1.641 seconds)
>
> 0: jdbc:ignite:thin://127.0.0.1>
>
> On Thu, Nov 30, 2017 at 9:04 PM, Taras Ledkov <[hidden email]> wrote:
>> Hi,
>>
>> I cannot reproduce the issue with described steps.
>> Please check that the cache wasn't destroyed on the server.
>>
>> i.e. please execute SELECT query again after failed CREATE INDEX.
>>
>>
>>
>> On 30.11.2017 11:45, Naveen wrote:
>>> Has anyone got a chance to look into into this issue where I am trying to
>>> create an index, but its throwing an error saying cache does not exist
>>>
>>> 0: jdbc:ignite:thin://127.0.0.1>  select ACCOUNT_ID_LIST from
>>> "Customer".CUSTOMER where ACCOUNT_ID_LIST ='A100000001';
>>> +--------------------------------+
>>> |        ACCOUNT_ID_LIST         |
>>> +--------------------------------+
>>> | A100000001                     |
>>> +--------------------------------+
>>> 1 row selected (2.078 seconds)
>>>
>>> **0: jdbc:ignite:thin://127.0.0.1> CREATE INDEX idx_customer_accountId ON
>>> "Customer".CUSTOMER (ACCOUNT_ID_LIST);*
>>> *Error: Cache doesn't exist: Customer (state=50000,code=0)
>>> java.sql.SQLException: Cache doesn't exist: Customer
>>>           at
>>>
>>> org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:671)
>>>           at
>>>
>>> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)
>>>           at
>>>
>>> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:299)
>>>           at sqlline.Commands.execute(Commands.java:823)
>>>           at sqlline.Commands.sql(Commands.java:733)
>>>           at sqlline.SqlLine.dispatch(SqlLine.java:795)
>>>           at sqlline.SqlLine.begin(SqlLine.java:668)
>>>           at sqlline.SqlLine.start(SqlLine.java:373)
>>>           at sqlline.SqlLine.main(SqlLine.java:265)
>>> 0: jdbc:ignite:thin://127.0.0.1>
>>>
>>>
>>>
>>>
>>> --
>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>> --
>> Taras Ledkov
>> Mail-To: [hidden email]
>>
>
>

--
Taras Ledkov
Mail-To: [hidden email]

Naveen Naveen
Reply | Threaded
Open this post in threaded view
|

Re: Index not getting created

This issue got fixed after clean restart of the cluster and creating the
caches again.
I could create the index.
Do we have any option to set the affinity mapping for the cache which is
already created and holding data.

Thanks
Naveen



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
dsetrakyan dsetrakyan
Reply | Threaded
Open this post in threaded view
|

Re: Index not getting created

Hi Naveen, 

Affinity mapping is a critical portion of Ignite data distribution and cannot be changed. For more information, please refer to this documentation: https://apacheignite.readme.io/docs/affinity-collocation 

D.

On Wed, Dec 6, 2017 at 9:20 PM, Naveen <[hidden email]> wrote:
This issue got fixed after clean restart of the cluster and creating the
caches again.
I could create the index.
Do we have any option to set the affinity mapping for the cache which is
already created and holding data.

Thanks
Naveen