[jira] [Created] (IGNITE-11840) Annotation-based configuration creates not only nested fields, but the enclosing object as well

2019-05-07 Thread Alex Savitsky (JIRA)
Alex Savitsky created IGNITE-11840:
--

 Summary: Annotation-based configuration creates not only nested 
fields, but the enclosing object as well
 Key: IGNITE-11840
 URL: https://issues.apache.org/jira/browse/IGNITE-11840
 Project: Ignite
  Issue Type: Bug
  Components: general
Affects Versions: 2.7
Reporter: Alex Savitsky


Using the annotation-based example from the 
[documentation|https://apacheignite-sql.readme.io/docs/schema-and-indexes#annotation-based-configuration],
 I'm creating a cache of Person object, with a nested Address inside. The 
expectation is that the created SQL table would have 4 columns: "id", "name", 
"street", and "zip". However, it also creates a column named "address" of type 
OTHER, and there's no apparent way to turn the creation of that column off, 
without also losing the columns "street" and "zip". The OTHER type messes up 
most of the SQL tools, as they don't know how to deal with it.



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


[jira] [Created] (IGNITE-11827) Scalar doesn't support anonymous message listeners

2019-04-30 Thread Alex Savitsky (JIRA)
Alex Savitsky created IGNITE-11827:
--

 Summary: Scalar doesn't support anonymous message listeners
 Key: IGNITE-11827
 URL: https://issues.apache.org/jira/browse/IGNITE-11827
 Project: Ignite
  Issue Type: Bug
Affects Versions: 2.7
Reporter: Alex Savitsky


This works:


{code:scala}
import java.util.UUID

import org.apache.ignite.configuration.IgniteConfiguration
import org.apache.ignite.lang.IgniteBiPredicate
import org.apache.ignite.scalar.lang.ScalarPredicate2Function
import org.apache.ignite.scalar.scalar
import org.apache.ignite.scalar.scalar._

object TestIgniteMessagingScala extends App {
  class ScalaListener extends ScalarPredicate2Function[UUID, String](new 
IgniteBiPredicate[UUID, String] {
override def apply(nodeId: UUID, msg: String): Boolean = {
  System.out.println("Received ordered message [msg=" + msg + ", from=" + 
nodeId + ']')
  true
}
  })
  scalar(new 
IgniteConfiguration().setClientMode(true).setPeerClassLoadingEnabled(true)) {
val messaging = ignite$.message(ignite$.cluster.forRemotes)
messaging.remoteListen("MyUnOrderedTopic", new ScalaListener)
for (i <- 1 to 10)
  messaging.send("MyUnOrderedTopic", Integer.toString(i))
  }
}
{code}

However, trying to define the same listener in place, fails:

{code:scala}
import java.util.UUID

import org.apache.ignite.configuration.IgniteConfiguration
import org.apache.ignite.lang.IgniteBiPredicate
import org.apache.ignite.scalar.lang.ScalarPredicate2Function
import org.apache.ignite.scalar.scalar
import org.apache.ignite.scalar.scalar._

object TestIgniteMessagingScala extends App {
  scalar(new 
IgniteConfiguration().setClientMode(true).setPeerClassLoadingEnabled(true)) {
val messaging = ignite$.message(ignite$.cluster.forRemotes)
val listener: IgniteBiPredicate[UUID, String] = (nodeId: UUID, msg: String) 
=> {
  System.out.println("Received ordered message [msg=" + msg + ", from=" + 
nodeId + ']')
  true
}
messaging.remoteListen("MyUnOrderedTopic", listener)
for (i <- 1 to 10)
  messaging.send("MyUnOrderedTopic", Integer.toString(i))
  }
}
{code}

The exception is:


{noformat}
Exception in thread "main" class 
org.apache.ignite.binary.BinaryObjectException: Failed to deserialize object 
[typeName=org.apache.ignite.scalar.lang.ScalarPredicate2]
at 
org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:914)
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1764)
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1716)
at 
org.apache.ignite.internal.binary.GridBinaryMarshaller.deserialize(GridBinaryMarshaller.java:313)
at 
org.apache.ignite.internal.binary.BinaryMarshaller.unmarshal0(BinaryMarshaller.java:102)
at 
org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:82)
at 
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:10140)
at 
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:10169)
at 
org.apache.ignite.internal.GridMessageListenHandler.p2pUnmarshal(GridMessageListenHandler.java:194)
at 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.processStartRequest(GridContinuousProcessor.java:1362)
at 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.access$400(GridContinuousProcessor.java:111)
at 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor$2.onCustomEvent(GridContinuousProcessor.java:203)
at 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor$2.onCustomEvent(GridContinuousProcessor.java:194)
at 
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$4.onDiscovery0(GridDiscoveryManager.java:727)
at 
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$4.lambda$onDiscovery$0(GridDiscoveryManager.java:604)
at 
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$DiscoveryMessageNotifierWorker.body0(GridDiscoveryManager.java:2667)
at 
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$DiscoveryMessageNotifierWorker.body(GridDiscoveryManager.java:2705)
at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
at java.lang.Thread.run(Thread.java:748)
Caused by: class org.apache.ignite.binary.BinaryObjectException: Failed to read 
field [name=p]
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor.read(BinaryFieldAccessor.java:192)
at 
org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:875)
... 18 more
Caused by: class org.apache.ignite.binary.BinaryInvalidTypeException:

[jira] [Created] (IGNITE-11826) Unwrap Option[T] types for @QuerySqlField for known SQL types

2019-04-30 Thread Alex Savitsky (JIRA)
Alex Savitsky created IGNITE-11826:
--

 Summary: Unwrap Option[T] types for @QuerySqlField for known SQL 
types
 Key: IGNITE-11826
 URL: https://issues.apache.org/jira/browse/IGNITE-11826
 Project: Ignite
  Issue Type: Improvement
  Components: binary, sql
Affects Versions: 2.7
Reporter: Alex Savitsky


Currently, annotating an Option type with {{@QuerySqlField}} results in a DB 
column of type {{OTHER}}. It would be nice if known SQL types could be 
unwrapped from their optionals, so that, for example, {{@QuerySqlField name: 
Option[String]}} would result in a field of type {{VARCHAR}}



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


[jira] [Created] (IGNITE-11806) Wrong import statement listed in Scalar documentation

2019-04-24 Thread Alex Savitsky (JIRA)
Alex Savitsky created IGNITE-11806:
--

 Summary: Wrong import statement listed in Scalar documentation
 Key: IGNITE-11806
 URL: https://issues.apache.org/jira/browse/IGNITE-11806
 Project: Ignite
  Issue Type: Bug
  Components: documentation
Affects Versions: 2.7
Reporter: Alex Savitsky


Scalar documentation mentions the imports that need to be made in order to use 
full scalar syntax:
{quote}
h4. Importing

Scalar needs to be imported in a proper way so that necessary objects and 
implicit conversions got available in the scope:

{code:scala}
import org.apache.ignite.scalar._
import scalar._
{code}

This way you import object {{scalar}} as well as all methods declared or 
inherited in that object as well.
{quote}

The imports are wrong however, I had to look up the examples to figure out the 
correct ones:

{code:scala}
import org.apache.ignite.scalar.scalar
import org.apache.ignite.scalar.scalar._
{code}




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