Open pluradj opened 7 years ago
Let alone the fact that equals
should not be used on floating point...
The issue is that property step predicate values are not converted (to a supported type). In other words, an unsupported type is being passed (e.g. 1.1
unqualified becomes BigDecimal in groovy - one must use f
or d
to specify another type). Had the query used the same type as the underlying type, there would be no error: g.V(v).properties('float_prop').hasValue(1.1f).toList()
So, how do we solve this? 1) throw an error on any unsupported type (as-is), 2) ignore the error and just filter out any traversers, 3) have a special conversion from BigDecimal to Float or Double, 4) ??
This fails as expected:
gremlin> g.addV().property('float_prop',1.4)
Property value [1.4] is of type class java.math.BigDecimal is not supported
Reported on janusgraph-users thread
It is reproducible from the Gremlin Console.
Unlike the
HasStep
, theJanusGraphPropertiesStep
doesn't appear to handleFloat
vsDouble
vsBigDecimal
comparison gracefully -- Final Traversal[GraphStep(vertex,[v[4176]]), JanusGraphPropertiesStep([~value.eq(1.1)])]