Skip to content

Conversation

@gkorland
Copy link
Contributor

@gkorland gkorland commented Aug 7, 2018

No description provided.

ResultSet result = api.query("CREATE ({name:\"roi\",age:32})");
Assert.assertFalse(result.hasNext());

Assert.assertEquals("1", result.getStatistics().getStringValue(Label.NODES_CREATED));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do result.getStatistics().nodesCreated() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swilly22 Added accessors

ResultSet createResult2 = api.query("CREATE (:person{name:'amit',age:30})");

// Connect source and destination nodes.
ResultSet matchResult = api.query("MATCH (a:person), (b:person) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[knows]->(a)");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename matchResult, maybe resultset ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just following the rest of the results sets naming according to the query running

ResultSet create2Result = api.query("CREATE (:qhuman{name:'amit',age:30})");

// Connect source and destination nodes.
ResultSet connectResult= api.query("MATCH (a:qhuman), (b:qhuman) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[knows]->(b)");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's a qhuman, can't we simply use human?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the original tests, and since we don't really have Graph drop implementation I want to use different keys

Assert.assertNotNull(resultSet.getStatistics().getStringValue(Label.QUERY_INTERNAL_EXECUTION_TIME));

Record record = resultSet.next();
Assert.assertEquals( "roi", record.getString(1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't assume order, position 1 for name, position 0 for age,
unless you specify the order of return attributes.
Use getString("name") and getString("age")

@swilly22 swilly22 merged commit eb5c205 into RedisGraph:master Aug 7, 2018
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

Successfully merging this pull request may close these issues.

2 participants