Closed HyunsungJo closed 8 years ago
The "interval" option doesn't seem to work on secondary indices.
Create service.
curl -XPOST localhost:9000/graphs/createService -H 'Content-Type: Application/json' -d ' { "serviceName": "interval", "hTableName": "interval-dev" } '
Create label with more than multiple indices.
curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type: Application/json' -d ' { "label": "interval_test", "srcServiceName": "interval", "srcColumnName": "ad_id", "srcColumnType": "string", "tgtServiceName": "interval", "tgtColumnName": "url", "tgtColumnType": "string", "isDirected": "true", "indices": [ { "name": "_PK", "propNames": [ "_timestamp" ] }, { "name": "IDX_ACTION_TYPE", "propNames": [ "actionType", "_timestamp" ] } ], "props": [ { "name": "serviceName", "defaultValue": "", "dataType": "string" }, { "name": "actionType", "defaultValue": "", "dataType": "string" } ], "consistencyLevel": "strong" } '
Insert test data.
curl -XPOST -H 'Content-Type: application/json' localhost:9000/graphs/edges/insert -d ' [ { "from": "jojo", "to": "www.kakaocorp.com", "label": "interval_test", "props": {"serviceName": "talk-scrap", "actionType": "share"}, "timestamp": 1433495457557 } ] '
Query with interval on primary index. => This works! (edge returned)
curl -XPOST localhost:9000/graphs/getEdges -H 'Content-type: Application/json' -d ' { "srcVertices": [ { "serviceName": "interval", "columnName": "ad_id", "id": "jojo" } ], "steps": [ { "step": [ { "label": "interval_test", "index": "_PK", "interval": { "from": [ { "_timestamp": 1433495457556 } ], "to": [ { "_timestamp": 1433495457558 } ] } } ] } ] } '
Query with interval on secondary index. => Doesn't work!! (empty result..)
curl -XPOST localhost:9000/graphs/getEdges -H 'Content-type: Application/json' -d ' { "srcVertices": [ { "serviceName": "interval", "columnName": "ad_id", "id": "jojo" } ], "steps": [ { "step": [ { "label": "interval_test", "index": "IDX_ACTION_TYPE", "interval": { "from": [ { "actionType": "share" } ], "to": [ { "actionType": "share" } ] } } ] } ] } '
The function interval() in QueryParam.scala uses labelOrderSeq witch is currently not set at time of function call. In function parseQueryParam() of RequestParser.scala, .interval(interval) should come after .labelOrderSeq(indexSeq).
interval()
QueryParam.scala
labelOrderSeq
parseQueryParam()
RequestParser.scala
.interval(interval)
.labelOrderSeq(indexSeq)
:+1:
Problem
The "interval" option doesn't seem to work on secondary indices.
Steps to Reproduce Issue
Create service.
Create label with more than multiple indices.
Insert test data.
Query with interval on primary index. => This works! (edge returned)
Query with interval on secondary index. => Doesn't work!! (empty result..)
Cause of Issue
The function
interval()
inQueryParam.scala
useslabelOrderSeq
witch is currently not set at time of function call. In functionparseQueryParam()
ofRequestParser.scala
,.interval(interval)
should come after.labelOrderSeq(indexSeq)
.