You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@s2graph.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/01/15 03:46:39 UTC

[jira] [Commented] (S2GRAPH-18) Query Option "interval" is Broken

    [ https://issues.apache.org/jira/browse/S2GRAPH-18?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15101095#comment-15101095 ] 

ASF GitHub Bot commented on S2GRAPH-18:
---------------------------------------

GitHub user daewon opened a pull request:

    https://github.com/apache/incubator-s2graph/pull/9

    [S2GRAPH-18] Query Option "interval" is Broken

    Remove the `interval option` was set twice

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/daewon/incubator-s2graph S2GRAPH-18

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-s2graph/pull/9.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #9
    
----
commit ed3eb26e2582c856b2998e3742e9ada18c13e1b4
Author: daewon <da...@apache.org>
Date:   2016-01-15T02:41:49Z

    Fix the bug: interval set twice

----


> 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)