Unexpected query results with DSE Java Driver - datastax-enterprise

I’m getting unexpected results using the DSE Java Driver with the query below:
List<Object> results = DseGraph.traversal(session).V()
.has("name", "marko").out("knows").values("name")
.toBulkSet().stream().collect(Collectors.toList());
I expected the returned List to contain 2 items of type String in the list being “vadas” and “josh”,
But instead it’s returning a list with 2 items of type LinkedHashMap with first item with key as result and the value as vadas and second item as key as result and the value as josh.
Any idea why?

Apparently dse-java-driver-core 1.2.3 returns the results in LinkedHashMap. Whereas 1.4.0 returns List of String.

Related

convert neo4j cypher list of integer not working

I have list property [1,2,2,0]. The value is the list default to type of long. To convert to a list of type integer I am using
apoc.convert.toIntList([1,2,2,0])
but the result is still a list of type long.....however
apoc.convert.toStringList([1,2,2,0])
does result in a list of strings. This my query:
MERGE (bs:Bslot {date: $date})
ON CREATE
SET bs.slots = [1,2,2,0]
RETURN {slots: apoc.convert.toIntList(bs.slots)}
What am I doing wrong here?
It is working as expected; see below example:
WITH [1,2,2,0.99] as slots
RETURN {slots: apoc.convert.toIntList(slots)}
Result:
╒════════════════════════════════════════╕
│"{slots: apoc.convert.toIntList(slots)}"│
╞════════════════════════════════════════╡
│{"slots":[1,2,2,0]} │
└────────────────────────────────────────┘
Notice that 0.99 (float) becomes an integer.
In your example; MERGE will not update slots property when that node Bslot with date equals $date. It is because it will only set the value of slots to [1,2,2,0] if that node is new (create).

'WHERE' query issue in Ruby on Rails when the column is integer and string is passed as argument

I am facing an issue, while users randomly insert the string in the URL instead of primaryID. It is returning the response even though there is no record matching that string.
Model.where(id: "014aqe-133dff-232asd-1233") will result in the below SQL statement:
SELECT `hp_cases`.* FROM `hp_cases` WHERE `hp_cases`.`id` = 14
which is the same as Model.where(id: 14). I know the issue happens due to a string-to-integer conversion. Is there a solution other than changing the column type to string?

Excel Power Query: Passing parameter to oDataFeed URL throws error

When a direct number for the TestPlanID is given it works.
When passing the value from sheet to a Query and then appending it to URL throws an error.
Expression.Error: We cannot apply operator & to types Text and Number.
Details:
Operator=&
Left=https://analytics.dev.azure.com/OrgName/ProjName/_odata/v3.0-preview/TestPoints?$apply=filter((TestSuite/TestPlanId eq
Right=39128
Can you try
eq"""&varTPID&"""
If value of varTPID is an integer/decimal, can you change the first line in power query to varTPID=Text.From(varTestPlanID) and then use eq"""&varTPID&"""
Also I think, TestPoints?"&"$apply needs to be changed to TestPoints?$apply

In QUERY on unique values, NO_COLUMN error

I have a list of U.S. states where duplicate values are also available. I need to find how many unique states are there in a list.
'Unique' function returns all the unique states but in conjunction with 'query' function the following error message is returned:
Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: A
=query(unique(A3:A26),"Select count(A)")
What am I doing wrong?
Having reconstructed the data (after UNIQUE it is different) you can't then continue with letters for column references. So:
=query(unique(A3:A26),"Select count(Col1)")

How do i check for a label in neo4j 2.1.2 when using a legacy index?

I just upgraded to Neo4j 2.1.2 from 2.0.1 and some of my cypher-queries stopped working.
I am using a self-defined Lucene index to find the startnodes, navigate via a typed relationship (Partner_PartnerMeta) to a typed Node(PartnerTyp). After that i just return a subset of these nodes.
My query previously used to check for the type of startnode (PartnerMeta). Since 2.1.2 the query
START partnermeta = node:PartnerTyp_Meta("Namen:wilhelm*")
MATCH (partner:PartnerTyp)-[:Partner_PartnerMeta]->(partnermeta:PartnerMeta)
RETURN DISTINCT partner SKIP 0 LIMIT 10
results in
Cannot add labels or properties on a node which is already bound (line 2, column 52)
"MATCH (partner:PartnerTyp)-[:Partner_PartnerMeta]->(partnermeta:PartnerMeta)"
^
This error can be suppressed by omitting the ":PartnerMeta" part of the query. As the type of the node returned from the index hasn't been checked yet, i would like to verify that it is of the type "PartnerMeta" (maybe i am too paranoid that way).
My question is:
Is there a possibility to check for the type of node after the usage of START in combination with a legacy index?
This is a regression in Cypher 2.1.2 which will be fixed. It was an attempt to avoid invalid combinations of label checks.
For now, can you try:
START partnermeta = node:PartnerTyp_Meta("Namen:wilhelm*")
MATCH (partner:PartnerTyp)-[:Partner_PartnerMeta]->(partnermeta)
WHERE partnermeta:PartnerMeta
RETURN DISTINCT partner SKIP 0 LIMIT 10

Resources