[ https://issues.apache.org/jira/browse/S2GRAPH-18?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15101249#comment-15101249 ]
ASF GitHub Bot commented on S2GRAPH-18: --------------------------------------- Github user SteamShon commented on the pull request: https://github.com/apache/incubator-s2graph/pull/9#issuecomment-171879273 @daewon :+1: > Query Option "interval" is Broken > --------------------------------- > > Key: S2GRAPH-18 > URL: https://issues.apache.org/jira/browse/S2GRAPH-18 > Project: S2Graph > Issue Type: Bug > Reporter: Hyunsung Jo > Assignee: Daewon Jeong > > *Problem* > The {{interval}} option doesn't seem to work on secondary indices. > *Steps to Reproduce Issue* > 1. Create service. > {noformat} > curl -XPOST localhost:9000/graphs/createService -H 'Content-Type: > Application/json' -d ' > { > "serviceName": "interval", > "hTableName": "interval-dev" > } > ' > {noformat} > 2. Create label with more than multiple indices. > {noformat} > 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" > } > ' > {noformat} > 3. Insert test data. > {noformat} > 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 > } > ] > ' > {noformat} > 4. Query with interval on primary index. => This works! (edge returned) > {noformat} > 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 > } > ] > } > } > ] > } > ] > } > ' > {noformat} > 5. Query with interval on secondary index. => Doesn't work!! (empty result..) > {noformat} > 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" > } > ] > } > } > ] > } > ] > } > ' > {noformat} > *Cause of Issue* > 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)}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)