IntelLabs / vdms

VDMS: Your Favorite Visual Data Management System
MIT License
84 stars 31 forks source link

Same property with value of different datatype breaks result set #57

Closed mwahle closed 5 years ago

mwahle commented 5 years ago

Property x, once a string, once an int. We search for the int and get an error back:

db.query([{'AddEntity': {'class': 'Test1', 'properties': {'x': 1}}}])
Out[8]: ([{'AddEntity': {'info': '', 'status': 0}}], [])

db.query([{'AddEntity': {'class': 'Test1', 'properties': {'x': '1'}}}])
Out[9]: ([{'AddEntity': {'info': '', 'status': 0}}], [])

db.query([{"FindEntity": {'class': 'Test1', 'constraints': {'x': ['==', 1]}}}])
Out[11]: 
([{'FailedCommand': 'Transaction',
   'info': 'Failed PMGDTransaction',
   'status': -1}],
[])
vishakha041 commented 5 years ago

This scenario won't work at all and fail at the second query when there is an index on the <class, property key> pair. Without an index, this will fail because the constraint casts the property as an integer which gets compared to a string in the second node. This is expected behavior. If you want to print properties of different types but same keys, the constraint block needs some other property that has same data type everywhere.

vishakha041 commented 5 years ago

For now I am closing this bug. Please let me know if you want to discuss any specific scenario in particular.