Thanks Dmitriy,
My cache "Model" was not in the configuration file, but it is in the jdbc
query string.
[Q. Why do we need to mention the cache config in the xml seaparately, if
we are providing the cache name in ths jdbc string]
I added the config as follows:
<property name="cacheConfiguration">
<bean
class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="Model"/>
<property name="cacheMode" value="PARTITIONED"/>
<property name="indexedTypes">
<list>
<value>java.lang.Long</value>
<value>com.sample.ignite.cache.Model</value>
</list>
</property>
</bean>
</property>
I had to add my jar to the ignite interpreter and restart.
I ran into the following issue:
%ignite.ignitesql
select count(*) from Model;
Failed to query Ignite.
Failed to run map query remotely.
Failed to execute map query on the node:
18361c6d-556c-46b1-9634-8d2361537943, class
org.apache.ignite.IgniteCheckedException:Failed to parse SQL query: SELECT
COUNT(*) __C0
FROM "Model".MODEL
Log dump:
INFO [2016-02-04 04:19:10,771] ({pool-2-thread-3}
AbstractApplicationContext.java[prepareRefresh]:510) - Refreshing
org.springframework.context.support.GenericApplicationContext@b4235b8:
startup date [Thu Feb 04 04:19:10 CST 2016]; root of context hierarchy
INFO [2016-02-04 04:19:14,930] ({pool-2-thread-3}
IgniteSqlInterpreter.java[open]:98) - Successfully created JDBC connection
ERROR [2016-02-04 04:19:15,025] ({pool-2-thread-3}
IgniteSqlInterpreter.java[interpret]:157) - Exception in
IgniteSqlInterpreter while InterpreterResult interpret:
java.sql.SQLException: Failed to query Ignite.
at
org.apache.ignite.internal.jdbc2.JdbcStatement.executeQuery(JdbcStatement.java:115)
at
org.apache.zeppelin.ignite.IgniteSqlInterpreter.interpret(IgniteSqlInterpreter.java:131)
at
org.apache.zeppelin.interpreter.ClassloaderInterpreter.interpret(ClassloaderInterpreter.java:57)
at
org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:93)
at
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:312)
at org.apache.zeppelin.scheduler.Job.run(Job.java:171)
at
org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.cache.CacheException: Failed to run map query remotely.
at
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.query(GridReduceQueryExecutor.java:585)
at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$2.iterator(IgniteH2Indexing.java:956)
at
org.apache.ignite.internal.processors.cache.QueryCursorImpl.iterator(QueryCursorImpl.java:61)
at
org.apache.ignite.internal.jdbc2.JdbcQueryTask.call(JdbcQueryTask.java:150)
at
org.apache.ignite.internal.jdbc2.JdbcStatement.executeQuery(JdbcStatement.java:102)
... 13 more
Caused by: javax.cache.CacheException: Failed to execute map query on the
node: 18361c6d-556c-46b1-9634-8d2361537943, class
org.apache.ignite.IgniteCheckedException:Failed to parse SQL query: SELECT
COUNT(*) __C0
FROM "Model".MODEL
at
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.fail(GridReduceQueryExecutor.java:257)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.onFail(GridReduceQueryExecutor.java:247)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.onMessage(GridReduceQueryExecutor.java:228)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor$1.onMessage(GridReduceQueryExecutor.java:176)
at
org.apache.ignite.internal.managers.communication.GridIoManager$ArrayListener.onMessage(GridIoManager.java:1821)
at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:821)
at
org.apache.ignite.internal.managers.communication.GridIoManager.access$1600(GridIoManager.java:103)
at
org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:784)
... 3 more
INFO [2016-02-04 04:19:15,061] ({pool-2-thread-3}
SchedulerFactory.java[jobFinished]:135) - Job
remoteInterpretJob_1454581149992 finished by scheduler
org.apache.zeppelin.ignite.IgniteSqlInterpreter231259423
On Thu, Feb 4, 2016 at 4:13 AM, Dmitriy Setrakyan <[email protected]>
wrote:
> Syed,
>
> Are you sure you have defined a cache named “Model” in your server
> configuration file? Can you please paste your server configuration file
> here?
>
> D.
>
> On Wed, Feb 3, 2016 at 5:58 AM, Syed Moizuddin <[email protected]>
> wrote:
>
>> Hi Andrey,
>>
>> Its yes for all 3 points. Any other thing you want me to verify
>>
>> Regards
>> Moiz
>> On Feb 3, 2016 7:06 PM, "Andrey Gura" <[email protected]> wrote:
>>
>>> Moiz,
>>>
>>> I can't reproduce problem that you describe. Could you please check the
>>> following:
>>>
>>> 1. Interpreter was restarted after configuration changes.
>>> 2. Cache name is correct (note that cache name is case sensitive).
>>> 3. Cache is partitioned or replicated (not local)
>>>
>>> Thanks!
>>>
>>>
>>> On Wed, Feb 3, 2016 at 12:36 PM, Syed Moizuddin <[email protected]>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to use Zeppelin with Ignite interpreter.
>>>>
>>>> The ignite.jdbc.url is
>>>> jdbc:ignite:cfg://cache=Model@file:///tmp/default-ignite-jdbc.xml
>>>> where default-ignite.xml is placed in the same node where zeppelin
>>>> server is running (under /tmp)
>>>>
>>>> When i run a sql (select count(*) from Model) in the notebook I get
>>>> "Client is invalid. Probably cache name is wrong."
>>>>
>>>> However I do see #clients increment in all the ignite nodes' logs.
>>>>
>>>> Also I am able to run the same query through a java program. ( My
>>>> cache is loaded)
>>>>
>>>> Please help me point what I am doing wrong here.
>>>>
>>>> Regards,
>>>> Moiz
>>>>
>>>
>>>
>>>
>>> --
>>> Andrey Gura
>>> GridGain Systems, Inc.
>>> www.gridgain.com
>>>
>>
>