You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Thomas Isaksen <th...@sysco.no> on 2018/01/15 10:11:46 UTC

SQL Error: Failed to query Ignite

Hi guys !
I am not in any way sure that I'm on the right track here so please bear with me.

I have a single node running with my cache:

[10:48:34,480][INFO][main][IgniteKernal] Configured caches [in 'sysMemPlc' dataRegion: ['ignite-sys-cache'], in 'default' dataRegion: ['tokenCache']]

I want my table "Token" to use the "tokenCacheTemplate" configuration and I want to use native persistence (no 3rd. party db.)

I am connecting with DBeaver with the following connect string:

jdbc:ignite:cfg://file:///D:\apache-ignite-fabric-2.3.0-bin\config\gatekeeper-token-config.xml
(I can connect to jdbc:ignite:thin://127.0.0.1 but then I'll just be connected to ignite-sys-cache - seemingly.)

I get a connection but once I try to create a table I get:

SQL Error: Failed to query Ignite.
  Failed to query Ignite.
    Ouch! Argument is invalid: Cache name must not be null or empty.

The table def. is :

CREATE TABLE IF NOT EXISTS Token
(
       id bigint,
       token VARCHAR,
       PRIMARY KEY (id)
)
WITH "template=tokenCacheTemplate";

Where <tokenCacheTemplate> is defined in the above config file as follows:

<?xml version="1.0" encoding="UTF-8"?>
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
   <property name="cacheConfiguration">
      <list>
         <bean id="tokenCacheTemplate" class="org.apache.ignite.configuration.CacheConfiguration">
            <property name="name" value="tokenCache" />
            <property name="cacheMode" value="PARTITIONED" />
            <property name="backups" value="1" />
            <!--<property name="readThrough" value="true"/>-->
            <!-- read from db if doesn't exist in cache -->
         </bean>
      </list>
   </property>
   <property name="dataStorageConfiguration">
      <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
         <property name="defaultDataRegionConfiguration">
            <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
               <property name="persistenceEnabled" value="true" />
            </bean>
         </property>
      </bean>
   </property>
</bean>


Thanks!

RE: SQL Error: Failed to query Ignite

Posted by Thomas Isaksen <th...@sysco.no>.
I deleted everything under $IGNITE_HOME/work and it's working as expected now. I probably messed up big with all my different configuration attempts :)
Again, thank you so much for your help!

./t

-----Original Message-----
From: slava.koptilin [mailto:slava.koptilin@gmail.com] 
Sent: mandag 15. januar 2018 16.44
To: user@ignite.apache.org
Subject: RE: SQL Error: Failed to query Ignite

Hi,

> Now my question is simply, why the star? What does it do?
"*" means that it is a cache template :)

> I now have two "identical" caches
Hmm, I cannot reproduce that behavior. Please share your Ignite configuration.

Thanks!




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

RE: SQL Error: Failed to query Ignite

Posted by "slava.koptilin" <sl...@gmail.com>.
Hi,

> Now my question is simply, why the star? What does it do?
"*" means that it is a cache template :)

> I now have two "identical" caches
Hmm, I cannot reproduce that behavior. Please share your Ignite
configuration.

Thanks!




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

RE: SQL Error: Failed to query Ignite

Posted by Thomas Isaksen <th...@sysco.no>.
Another thing, I now have two "identical" caches, is this correct? I assumed I would just end up with SQL_PUBLIC_TOKEN

+-----------------------------+-------------+-------+---------------------------+-----------+-----------+-----------+-----------+
| SQL_PUBLIC_TOKEN(@c2)       | PARTITIONED | 2     | min: 0 (0 / 0)            | min: 0    | min: 0    | min: 0    | min: 0    |
|                             |             |       | avg: 0.00 (0.00 / 0.00)   | avg: 0.00 | avg: 0.00 | avg: 0.00 | avg: 0.00 |
|                             |             |       | max: 0 (0 / 0)            | max: 0    | max: 0    | max: 0    | max: 0    |
+-----------------------------+-------------+-------+---------------------------+-----------+-----------+-----------+-----------+
| tokenCache(@c3)             | PARTITIONED | 2     | min: 0 (0 / 0)            | min: 0    | min: 0    | min: 0    | min: 0    |
|                             |             |       | avg: 0.50 (0.00 / 0.50)   | avg: 0.00 | avg: 0.00 | avg: 0.00 | avg: 0.00 |
|                             |             |       | max: 1 (0 / 1)            | max: 0    | max: 0    | max: 0    | max: 0    |
+-------------------------------------------------------------------------------------------------------------------------------+


-----Original Message-----
From: Thomas Isaksen [mailto:thomas.isaksen@sysco.no] 
Sent: mandag 15. januar 2018 12.19
To: user@ignite.apache.org
Subject: RE: SQL Error: Failed to query Ignite

Yes! That did it! Now my question is simply, why the star? What does it do. I thought I had to use template=<bean id>

Thanks heaps!

./t

-----Original Message-----
From: slava.koptilin [mailto:slava.koptilin@gmail.com] 
Sent: mandag 15. januar 2018 11.55
To: user@ignite.apache.org
Subject: Re: SQL Error: Failed to query Ignite

Hi Thomas,

Please try to configure your template in the following way:

<property name="cacheConfiguration">
    <list>
        <bean id="tokenCacheTemplate"
class="org.apache.ignite.configuration.CacheConfiguration">
            <property name=&quot;name&quot; value=&quot;tokenCache&lt;b>**"
/>
            <property name="cacheMode" value="PARTITIONED" />
            <property name="backups" value="1" />
            
            
        </bean>
    </list>
</property>

In that case, you should be able to create a table via thin driver:

CREATE TABLE TOKEN(id LONG, token VARCHAR, PRIMARY KEY (id)) WITH template=tokenCache;

Thanks,
Slava.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

RE: SQL Error: Failed to query Ignite

Posted by Thomas Isaksen <th...@sysco.no>.
Yes! That did it! Now my question is simply, why the star? What does it do. I thought I had to use template=<bean id>

Thanks heaps!

./t

-----Original Message-----
From: slava.koptilin [mailto:slava.koptilin@gmail.com] 
Sent: mandag 15. januar 2018 11.55
To: user@ignite.apache.org
Subject: Re: SQL Error: Failed to query Ignite

Hi Thomas,

Please try to configure your template in the following way:

<property name="cacheConfiguration">
    <list>
        <bean id="tokenCacheTemplate"
class="org.apache.ignite.configuration.CacheConfiguration">
            <property name=&quot;name&quot; value=&quot;tokenCache&lt;b>**"
/>
            <property name="cacheMode" value="PARTITIONED" />
            <property name="backups" value="1" />
            
            
        </bean>
    </list>
</property>

In that case, you should be able to create a table via thin driver:

CREATE TABLE TOKEN(id LONG, token VARCHAR, PRIMARY KEY (id)) WITH template=tokenCache;

Thanks,
Slava.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: SQL Error: Failed to query Ignite

Posted by "slava.koptilin" <sl...@gmail.com>.
Hi Thomas,

Please try to configure your template in the following way:

<property name="cacheConfiguration">
    <list>
        <bean id="tokenCacheTemplate"
class="org.apache.ignite.configuration.CacheConfiguration">
            <property name=&quot;name&quot; value=&quot;tokenCache&lt;b>**"
/>
            <property name="cacheMode" value="PARTITIONED" />
            <property name="backups" value="1" />
            
            
        </bean>
    </list>
</property>

In that case, you should be able to create a table via thin driver:

CREATE TABLE TOKEN(id LONG, token VARCHAR, PRIMARY KEY (id)) WITH
template=tokenCache;

Thanks,
Slava.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/