Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set properties 'java.util.Date' scala.MatchError #344

Open
SeaofRoses opened this issue Dec 27, 2019 · 0 comments
Open

set properties 'java.util.Date' scala.MatchError #344

SeaofRoses opened this issue Dec 27, 2019 · 0 comments

Comments

@SeaofRoses
Copy link

SeaofRoses commented Dec 27, 2019

I try to insert a map like this

String addSql="create (n :Person) SET n += $properties return n";
Map<String, Object> properties=new HashMap<String, Object>();
properties.put("date",new Date());
Map<String, Object> map=new HashMap<String, Object>();
map.put("properties",propertiesMap);
CypherResultSet resultSet = cypherGremlinClient.submit(addSql,map);
List<Map<String, Object>> list = resultSet.all();

however 'java.util.Date' type cannot be inserted

Caused by: scala.MatchError: Tue Dec 03 00:00:00 CST 2019 (of class java.util.Date)
	at org.opencypher.gremlin.translation.walker.NodeUtils$.toLiteral(NodeUtils.scala:223)
	at org.opencypher.gremlin.translation.walker.SetWalker.$anonfun$asMap$2(SetWalker.scala:98)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
	at scala.collection.Iterator.foreach(Iterator.scala:937)
	at scala.collection.Iterator.foreach$(Iterator.scala:937)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1425)
	at scala.collection.IterableLike.foreach(IterableLike.scala:70)
	at scala.collection.IterableLike.foreach$(IterableLike.scala:69)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
	at scala.collection.TraversableLike.map(TraversableLike.scala:233)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.opencypher.gremlin.translation.walker.SetWalker.asMap(SetWalker.scala:96)
	at org.opencypher.gremlin.translation.walker.SetWalker.$anonfun$walkSetClause$1(SetWalker.scala:60)
	at scala.collection.immutable.List.foreach(List.scala:388)
	at org.opencypher.gremlin.translation.walker.SetWalker.walkSetClause(SetWalker.scala:56)
	at org.opencypher.gremlin.translation.walker.SetWalker.walkClause(SetWalker.scala:45)
	at org.opencypher.gremlin.translation.walker.SetWalker$.walkClause(SetWalker.scala:35)
	at org.opencypher.gremlin.translation.walker.StatementWalker.walkClause(StatementWalker.scala:123)
	at org.opencypher.gremlin.translation.walker.StatementWalker.$anonfun$walkSingle$1(StatementWalker.scala:84)
	at org.opencypher.gremlin.translation.walker.StatementWalker.$anonfun$walkSingle$1$adapted(StatementWalker.scala:84)
	at scala.collection.immutable.List.foreach(List.scala:388)
	at org.opencypher.gremlin.translation.walker.StatementWalker.walkSingle(StatementWalker.scala:84)
	at org.opencypher.gremlin.translation.walker.StatementWalker.walk(StatementWalker.scala:45)
	at org.opencypher.gremlin.translation.walker.StatementWalker$.walk(StatementWalker.scala:32)
	at org.opencypher.gremlin.translation.CypherAst.translate(CypherAst.scala:98)
	at org.opencypher.gremlin.translation.CypherAst.buildTranslation(CypherAst.scala:119)
	at org.opencypher.gremlin.client.GroovyCypherGremlinClient.submitAsync(GroovyCypherGremlinClient.java:68)
	at org.opencypher.gremlin.client.CypherGremlinClient.submitAsync(CypherGremlinClient.java:231)
	at org.opencypher.gremlin.client.CypherGremlinClient.submit(CypherGremlinClient.java:200)
	at )

I found that 'Java. Util. Date' was not processed in NodeUtils.toLiteral()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant