Re: Failed to parse query: exception with Scala

2017-11-08 Thread future expert
I think I found something interesting. I see the below when i print the
current topology from visor.

[image: Inline image 1]

The "1%lo" string that is under the Int./Ext. IPs is the same as the string
that is included in the below exception when
*sharedRDDConsumer.first() or
**sharedRDDConsumer.take(5).foreach(println)
*is executed*. *

java.lang.NumberFormatException: For input string: *"1%lo"*
at java.lang.NumberFormatException.forInputString(NumberFormatE
xception.java:65)

Is this a possible bug?


>
>
>
> On Wed, Nov 8, 2017 at 11:00 AM, future expert  > wrote:
>
>> I am just trying to retrieve the already cached shared-rdd(
>> sharedRDDProducer) back from cache. I have also tried like below too
>> without success.
>>
>> *val *sharedRDDConsumer*: IgniteRDD[String, String] =
>> igniteContext.fromCache[String, String]("*sharedRDDProducer*")*
>>
>> I am getting the same error even when running the below example program
>>
>> Exception   : class javax.cache.CacheException
>> Message : class org.apache.ignite.internal.pro
>> cessors.query.IgniteSQLException: Failed to parse query: select _val
>> from String
>>
>> Also, not sure why the retrieved RDD count() always shows 1 instead of
>> the actual recordcount!
>>
>> Thanks.
>>
>>
>> On Wed, Nov 8, 2017 at 8:45 AM, Evgenii Zhuravlev <
>> e.zhuravlev...@gmail.com> wrote:
>>
>>> I don't really get, what you trying to do here:
>>>
>>> val sharedRDDConsumer = igniteContext.fromCache("sharedRDDProducer")
>>>
>>> it looks like a mistake
>>>
>>> Here is example of using ignite sql from spark in java:
>>>
>>> https://github.com/apache/ignite/blob/master/examples/src/ma
>>> in/spark/org/apache/ignite/examples/spark/SharedRDDExample.java
>>>
>>> the same for scala:
>>>
>>> https://github.com/apache/ignite/blob/master/examples/src/ma
>>> in/scala/org/apache/ignite/scalar/examples/spark/ScalarShare
>>> dRDDExample.scala
>>>
>>> 2017-11-08 19:02 GMT+03:00 future expert :
>>>
 Thanks. I currently do not have indexed types for cache
 "sharedRDDProducer" as i currently add it as below.

 *val sharedRDDProducer: IgniteRDD[String, String] =
 igniteContext.fromCache[String, String]("sharedRDDProducer")*
 *sharedRDDProducer.savePairs(jsonRdd)*

 Is the indexed types needed for sharedRDDProducer as well? If so, how
 can I add it?

 Also, I am getting the below exception with all the different types of
 datasets when trying to do a *sharedRDDConsumer.first() or 
 **sharedRDDConsumer.take(5).foreach(println).
 *I think that something is wrong with the saved sharedRDDProducer. Could
 it be an Ignite version issue?

 java.lang.NumberFormatException: For input string: "1%lo"
 at java.lang.NumberFormatException.forInputString(NumberFormatE
 xception.java:65)


 I tried the below example using [Int, Int] rdd as well but the SQL part
 at the end is giving the same exception. Do you have a working SQL query
 sample in scala using [string, string] pair rdd? Thanks.

 https://github.com/apache/ignite/blob/master/examples/src/ma
 in/scala/org/apache/ignite/scalar/examples/spark/ScalarShare
 dRDDExample.scala




 On Wed, Nov 8, 2017 at 6:27 AM, ezhuravlev 
 wrote:

> Do you have indexed types for cache "sharedRDDProducer"?
>
> like
>
> cacheCfg.setIndexedTypes(String.class, String.class);
>
> Evgenii
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


>>>
>>
>


Re: Failed to parse query: exception with Scala

2017-11-08 Thread future expert
Any suggestions on the below will be really appreciated.

Thanks.



On Wed, Nov 8, 2017 at 11:00 AM, future expert 
wrote:

> I am just trying to retrieve the already cached shared-rdd(
> sharedRDDProducer) back from cache. I have also tried like below too
> without success.
>
> *val *sharedRDDConsumer*: IgniteRDD[String, String] =
> igniteContext.fromCache[String, String]("*sharedRDDProducer*")*
>
> I am getting the same error even when running the below example program
>
> Exception   : class javax.cache.CacheException
> Message : class org.apache.ignite.internal.pro
> cessors.query.IgniteSQLException: Failed to parse query: select _val from
> String
>
> Also, not sure why the retrieved RDD count() always shows 1 instead of the
> actual recordcount!
>
> Thanks.
>
>
> On Wed, Nov 8, 2017 at 8:45 AM, Evgenii Zhuravlev <
> e.zhuravlev...@gmail.com> wrote:
>
>> I don't really get, what you trying to do here:
>>
>> val sharedRDDConsumer = igniteContext.fromCache("sharedRDDProducer")
>>
>> it looks like a mistake
>>
>> Here is example of using ignite sql from spark in java:
>>
>> https://github.com/apache/ignite/blob/master/examples/src/
>> main/spark/org/apache/ignite/examples/spark/SharedRDDExample.java
>>
>> the same for scala:
>>
>> https://github.com/apache/ignite/blob/master/examples/src/
>> main/scala/org/apache/ignite/scalar/examples/spark/ScalarSh
>> aredRDDExample.scala
>>
>> 2017-11-08 19:02 GMT+03:00 future expert :
>>
>>> Thanks. I currently do not have indexed types for cache
>>> "sharedRDDProducer" as i currently add it as below.
>>>
>>> *val sharedRDDProducer: IgniteRDD[String, String] =
>>> igniteContext.fromCache[String, String]("sharedRDDProducer")*
>>> *sharedRDDProducer.savePairs(jsonRdd)*
>>>
>>> Is the indexed types needed for sharedRDDProducer as well? If so, how
>>> can I add it?
>>>
>>> Also, I am getting the below exception with all the different types of
>>> datasets when trying to do a *sharedRDDConsumer.first() or 
>>> **sharedRDDConsumer.take(5).foreach(println).
>>> *I think that something is wrong with the saved sharedRDDProducer. Could
>>> it be an Ignite version issue?
>>>
>>> java.lang.NumberFormatException: For input string: "1%lo"
>>> at java.lang.NumberFormatException.forInputString(NumberFormatE
>>> xception.java:65)
>>>
>>>
>>> I tried the below example using [Int, Int] rdd as well but the SQL part
>>> at the end is giving the same exception. Do you have a working SQL query
>>> sample in scala using [string, string] pair rdd? Thanks.
>>>
>>> https://github.com/apache/ignite/blob/master/examples/src/ma
>>> in/scala/org/apache/ignite/scalar/examples/spark/ScalarShare
>>> dRDDExample.scala
>>>
>>>
>>>
>>>
>>> On Wed, Nov 8, 2017 at 6:27 AM, ezhuravlev 
>>> wrote:
>>>
 Do you have indexed types for cache "sharedRDDProducer"?

 like

 cacheCfg.setIndexedTypes(String.class, String.class);

 Evgenii



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

>>>
>>>
>>
>


Re: Failed to parse query: exception with Scala

2017-11-08 Thread future expert
I am just trying to retrieve the already cached shared-rdd(
sharedRDDProducer) back from cache. I have also tried like below too
without success.

*val *sharedRDDConsumer*: IgniteRDD[String, String] =
igniteContext.fromCache[String, String]("*sharedRDDProducer*")*

I am getting the same error even when running the below example program

Exception   : class javax.cache.CacheException
Message : class org.apache.ignite.internal.pro
cessors.query.IgniteSQLException: Failed to parse query: select _val from
String

Also, not sure why the retrieved RDD count() always shows 1 instead of the
actual recordcount!

Thanks.


On Wed, Nov 8, 2017 at 8:45 AM, Evgenii Zhuravlev 
wrote:

> I don't really get, what you trying to do here:
>
> val sharedRDDConsumer = igniteContext.fromCache("sharedRDDProducer")
>
> it looks like a mistake
>
> Here is example of using ignite sql from spark in java:
>
> https://github.com/apache/ignite/blob/master/examples/
> src/main/spark/org/apache/ignite/examples/spark/SharedRDDExample.java
>
> the same for scala:
>
> https://github.com/apache/ignite/blob/master/examples/
> src/main/scala/org/apache/ignite/scalar/examples/spark/
> ScalarSharedRDDExample.scala
>
> 2017-11-08 19:02 GMT+03:00 future expert :
>
>> Thanks. I currently do not have indexed types for cache
>> "sharedRDDProducer" as i currently add it as below.
>>
>> *val sharedRDDProducer: IgniteRDD[String, String] =
>> igniteContext.fromCache[String, String]("sharedRDDProducer")*
>> *sharedRDDProducer.savePairs(jsonRdd)*
>>
>> Is the indexed types needed for sharedRDDProducer as well? If so, how
>> can I add it?
>>
>> Also, I am getting the below exception with all the different types of
>> datasets when trying to do a *sharedRDDConsumer.first() or 
>> **sharedRDDConsumer.take(5).foreach(println).
>> *I think that something is wrong with the saved sharedRDDProducer. Could
>> it be an Ignite version issue?
>>
>> java.lang.NumberFormatException: For input string: "1%lo"
>> at java.lang.NumberFormatException.forInputString(NumberFormatE
>> xception.java:65)
>>
>>
>> I tried the below example using [Int, Int] rdd as well but the SQL part
>> at the end is giving the same exception. Do you have a working SQL query
>> sample in scala using [string, string] pair rdd? Thanks.
>>
>> https://github.com/apache/ignite/blob/master/examples/src/
>> main/scala/org/apache/ignite/scalar/examples/spark/ScalarSh
>> aredRDDExample.scala
>>
>>
>>
>>
>> On Wed, Nov 8, 2017 at 6:27 AM, ezhuravlev 
>> wrote:
>>
>>> Do you have indexed types for cache "sharedRDDProducer"?
>>>
>>> like
>>>
>>> cacheCfg.setIndexedTypes(String.class, String.class);
>>>
>>> Evgenii
>>>
>>>
>>>
>>> --
>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>>
>>
>>
>


Re: Failed to parse query: exception with Scala

2017-11-08 Thread Evgenii Zhuravlev
I don't really get, what you trying to do here:

val sharedRDDConsumer = igniteContext.fromCache("sharedRDDProducer")

it looks like a mistake

Here is example of using ignite sql from spark in java:

https://github.com/apache/ignite/blob/master/examples/src/main/spark/org/apache/ignite/examples/spark/SharedRDDExample.java

the same for scala:

https://github.com/apache/ignite/blob/master/examples/src/main/scala/org/apache/ignite/scalar/examples/spark/ScalarSharedRDDExample.scala

2017-11-08 19:02 GMT+03:00 future expert :

> Thanks. I currently do not have indexed types for cache
> "sharedRDDProducer" as i currently add it as below.
>
> *val sharedRDDProducer: IgniteRDD[String, String] =
> igniteContext.fromCache[String, String]("sharedRDDProducer")*
> *sharedRDDProducer.savePairs(jsonRdd)*
>
> Is the indexed types needed for sharedRDDProducer as well? If so, how can
> I add it?
>
> Also, I am getting the below exception with all the different types of
> datasets when trying to do a *sharedRDDConsumer.first() or 
> **sharedRDDConsumer.take(5).foreach(println).
> *I think that something is wrong with the saved sharedRDDProducer. Could
> it be an Ignite version issue?
>
> java.lang.NumberFormatException: For input string: "1%lo"
> at java.lang.NumberFormatException.forInputString(NumberFormatE
> xception.java:65)
>
>
> I tried the below example using [Int, Int] rdd as well but the SQL part at
> the end is giving the same exception. Do you have a working SQL query
> sample in scala using [string, string] pair rdd? Thanks.
>
> https://github.com/apache/ignite/blob/master/examples/
> src/main/scala/org/apache/ignite/scalar/examples/spark/
> ScalarSharedRDDExample.scala
>
>
>
>
> On Wed, Nov 8, 2017 at 6:27 AM, ezhuravlev 
> wrote:
>
>> Do you have indexed types for cache "sharedRDDProducer"?
>>
>> like
>>
>> cacheCfg.setIndexedTypes(String.class, String.class);
>>
>> Evgenii
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>
>


Re: Failed to parse query: exception with Scala

2017-11-08 Thread future expert
Thanks. I currently do not have indexed types for cache "sharedRDDProducer"
as i currently add it as below.

*val sharedRDDProducer: IgniteRDD[String, String] =
igniteContext.fromCache[String, String]("sharedRDDProducer")*
*sharedRDDProducer.savePairs(jsonRdd)*

Is the indexed types needed for sharedRDDProducer as well? If so, how can I
add it?

Also, I am getting the below exception with all the different types of
datasets when trying to do a *sharedRDDConsumer.first() or
**sharedRDDConsumer.take(5).foreach(println).
*I think that something is wrong with the saved sharedRDDProducer. Could it
be an Ignite version issue?

java.lang.NumberFormatException: For input string: "1%lo"
at java.lang.NumberFormatException.forInputString(NumberFormatE
xception.java:65)


I tried the below example using [Int, Int] rdd as well but the SQL part at
the end is giving the same exception. Do you have a working SQL query
sample in scala using [string, string] pair rdd? Thanks.

https://github.com/apache/ignite/blob/master/examples/src/main/scala/org/apache/ignite/scalar/examples/spark/ScalarSharedRDDExample.scala




On Wed, Nov 8, 2017 at 6:27 AM, ezhuravlev  wrote:

> Do you have indexed types for cache "sharedRDDProducer"?
>
> like
>
> cacheCfg.setIndexedTypes(String.class, String.class);
>
> Evgenii
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: Failed to parse query: exception with Scala

2017-11-08 Thread ezhuravlev
Do you have indexed types for cache "sharedRDDProducer"?

like

cacheCfg.setIndexedTypes(String.class, String.class);

Evgenii



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


Failed to parse query: exception with Scala

2017-11-07 Thread future expert
Ignite version: 2.1


   - I get the below exception when trying to query the shared pair rdd
   using sql.

Exception   : class javax.cache.CacheException
Message : class
org.apache.ignite.internal.processors.query.IgniteSQLException:
Failed to parse query: select _key, _val from String
Cause   : class
org.apache.ignite.internal.processors.query.IgniteSQLException:
Failed to parse query: select _key, _val from String
Stack Trace : org.apache.ignite.internal.processors.cache.
IgniteCacheProxy.query(IgniteCacheProxy.java:807)


Please see below.
*val jsonRdd = rawRdd.map(x => (x.id , x.json))*
*val sharedRDDProducer: IgniteRDD[String, String] =
igniteContext.fromCache[String, String]("sharedRDDProducer")*
*sharedRDDProducer.savePairs(jsonRdd)*

*val sharedRDDConsumer = igniteContext.fromCache("sharedRDDProducer")*
*val df = sharedRDDConsumer.sql("select _key, _val from String")*
*df.show(10)*


   - I have also tried using the below and it gives the same error.

*val cacheCfg = new CacheConfiguration[String, String]()*
*cacheCfg.setName("sharedRDDConsumer")*
*cacheCfg.setIndexedTypes(classOf[String], classOf[String])*
*val sharedRDD = igniteContext.fromCache(cacheCfg)*



   - Also, getting the below exception when trying
*sharedRDDConsumer.take(5).foreach(println).
   *Not sure if this is related to the above issue.

java.lang.NumberFormatException: For input string: "1%lo"
at java.lang.NumberFormatException.forInputString(
NumberFormatException.java:65)



   - The other thing i noticed is that the *count()* on
*sharedRDDConsumer *always
   gives 1 whereas *count() *on *jsonRdd *gives the valid record count of
   the jsonRdd*. *Is this the expected behavior of the IgniteRDD?

Kindly let me know if there are any suggestions. Thanks.