You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@asterixdb.apache.org by Eugenia Gabrielova <ge...@gmail.com> on 2015/06/09 09:18:47 UTC

Missing results key with AsterixDB REST API /query

*Issue:* Sending a query to the REST API returns a JSON object without the
expected "results" key (
https://asterixdb.ics.uci.edu/documentation/api.html#QueryApi)

*Running Asterix Version: *0.8.7

*To Replicate: *Run the Metadata query in web UI, or from the command line
with curl.
*for $ds in dataset Metadata.Dataset return $ds;*

*Result key missing with JSON results*
$ curl -i -X GET '
http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24ds%3B'
-H "Accept: application/json"

HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Server: Jetty(8.0.0.RC0)

[ { "DataverseName": "Metadata", "DatasetName": "CompactionPolicy",
"DataTypeName": "CompactionPolicyRecordType", "DatasetType": "INTERNAL",
"InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy":
"HASH", "PartitioningKey": { "orderedlist": [ { "orderedlist": [
"DataverseName" ] }, { "orderedlist": [ "CompactionPolicy" ] } ] },
"PrimaryKey": { "orderedlist": [ { "orderedlist": [ "DataverseName" ] }, {
"orderedlist": [ "CompactionPolicy" ] } ] }, "GroupName": "MetadataGroup",
"Autogenerated": false, "CompactionPolicy": "prefix",
"CompactionPolicyProperties": { "orderedlist": [ { "Name":
"max-mergable-component-size", "Value": "1073741824" }, { "Name":
"max-tolerance-component-count", "Value": "5" } ] } }, "ExternalDetails":
null, "Hints": { "unorderedlist": [  ] }, "Timestamp": "Sun Apr 19 16:41:50
PDT 2015", "DatasetId": { "int32":
13
}
, "PendingOp": { "int32":
0
}
 }
, { "DataverseName"
*...*
*...*
*...]*

*With asynchronous query, handle key as expected.*
$ curl -i -X GET '
http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24ds%3B&mode=asynchronous'
-H "Accept: application/json"

HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Server: Jetty(8.0.0.RC0)

{"handle":[38,0]}

*With erroneous query, error-code key as expected.*
$ curl -i -X GET '
http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24error%3B'
-H "Accept: application/json"

HTTP/1.1 500 Server Error
Content-Type: application/json;charset=utf-8
Content-Length: 62
Server: Jetty(8.0.0.RC0)

{"error-code":[2,"SyntaxError: can't find variable $error\n"]}

Re: Missing results key with AsterixDB REST API /query

Posted by Eugenia Gabrielova <ge...@gmail.com>.
Thank you for explaining. I'll ditch the workaround and make a note in my
code & test.

On Tue, Jun 9, 2015 at 5:49 PM, Ian Maxon <im...@uci.edu> wrote:

> So I see the change, for this and it's intentional:
> https://asterix-gerrit.ics.uci.edu/#/c/123/ . But the docs are lagging
> behind even in master:
> https://asterix-jenkins.ics.uci.edu/job/asterix-test-full/site/asterix-doc/api.html
> .
>
> On Tue, Jun 9, 2015 at 12:18 AM, Eugenia Gabrielova <
> genia.likes.science@gmail.com> wrote:
>
>> *Issue:* Sending a query to the REST API returns a JSON object without
>> the expected "results" key (
>> https://asterixdb.ics.uci.edu/documentation/api.html#QueryApi)
>>
>> *Running Asterix Version: *0.8.7
>>
>> *To Replicate: *Run the Metadata query in web UI, or from the command
>> line with curl.
>> *for $ds in dataset Metadata.Dataset return $ds;*
>>
>> *Result key missing with JSON results*
>> $ curl -i -X GET '
>> http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24ds%3B'
>> -H "Accept: application/json"
>>
>> HTTP/1.1 200 OK
>> Content-Type: application/json;charset=utf-8
>> Transfer-Encoding: chunked
>> Server: Jetty(8.0.0.RC0)
>>
>> [ { "DataverseName": "Metadata", "DatasetName": "CompactionPolicy",
>> "DataTypeName": "CompactionPolicyRecordType", "DatasetType": "INTERNAL",
>> "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy":
>> "HASH", "PartitioningKey": { "orderedlist": [ { "orderedlist": [
>> "DataverseName" ] }, { "orderedlist": [ "CompactionPolicy" ] } ] },
>> "PrimaryKey": { "orderedlist": [ { "orderedlist": [ "DataverseName" ] }, {
>> "orderedlist": [ "CompactionPolicy" ] } ] }, "GroupName": "MetadataGroup",
>> "Autogenerated": false, "CompactionPolicy": "prefix",
>> "CompactionPolicyProperties": { "orderedlist": [ { "Name":
>> "max-mergable-component-size", "Value": "1073741824" }, { "Name":
>> "max-tolerance-component-count", "Value": "5" } ] } }, "ExternalDetails":
>> null, "Hints": { "unorderedlist": [  ] }, "Timestamp": "Sun Apr 19 16:41:50
>> PDT 2015", "DatasetId": { "int32":
>> 13
>> }
>> , "PendingOp": { "int32":
>> 0
>> }
>>  }
>> , { "DataverseName"
>> *...*
>> *...*
>> *...]*
>>
>> *With asynchronous query, handle key as expected.*
>> $ curl -i -X GET '
>> http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24ds%3B&mode=asynchronous'
>> -H "Accept: application/json"
>>
>> HTTP/1.1 200 OK
>> Content-Type: application/json;charset=utf-8
>> Transfer-Encoding: chunked
>> Server: Jetty(8.0.0.RC0)
>>
>> {"handle":[38,0]}
>>
>> *With erroneous query, error-code key as expected.*
>> $ curl -i -X GET '
>> http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24error%3B'
>> -H "Accept: application/json"
>>
>> HTTP/1.1 500 Server Error
>> Content-Type: application/json;charset=utf-8
>> Content-Length: 62
>> Server: Jetty(8.0.0.RC0)
>>
>> {"error-code":[2,"SyntaxError: can't find variable $error\n"]}
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "asterixdb-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to asterixdb-users+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

Re: Missing results key with AsterixDB REST API /query

Posted by Ian Maxon <im...@uci.edu>.
So I see the change, for this and it's intentional:
https://asterix-gerrit.ics.uci.edu/#/c/123/ . But the docs are lagging
behind even in master:
https://asterix-jenkins.ics.uci.edu/job/asterix-test-full/site/asterix-doc/api.html
.

On Tue, Jun 9, 2015 at 12:18 AM, Eugenia Gabrielova <
genia.likes.science@gmail.com> wrote:

> *Issue:* Sending a query to the REST API returns a JSON object without
> the expected "results" key (
> https://asterixdb.ics.uci.edu/documentation/api.html#QueryApi)
>
> *Running Asterix Version: *0.8.7
>
> *To Replicate: *Run the Metadata query in web UI, or from the command
> line with curl.
> *for $ds in dataset Metadata.Dataset return $ds;*
>
> *Result key missing with JSON results*
> $ curl -i -X GET '
> http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24ds%3B'
> -H "Accept: application/json"
>
> HTTP/1.1 200 OK
> Content-Type: application/json;charset=utf-8
> Transfer-Encoding: chunked
> Server: Jetty(8.0.0.RC0)
>
> [ { "DataverseName": "Metadata", "DatasetName": "CompactionPolicy",
> "DataTypeName": "CompactionPolicyRecordType", "DatasetType": "INTERNAL",
> "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy":
> "HASH", "PartitioningKey": { "orderedlist": [ { "orderedlist": [
> "DataverseName" ] }, { "orderedlist": [ "CompactionPolicy" ] } ] },
> "PrimaryKey": { "orderedlist": [ { "orderedlist": [ "DataverseName" ] }, {
> "orderedlist": [ "CompactionPolicy" ] } ] }, "GroupName": "MetadataGroup",
> "Autogenerated": false, "CompactionPolicy": "prefix",
> "CompactionPolicyProperties": { "orderedlist": [ { "Name":
> "max-mergable-component-size", "Value": "1073741824" }, { "Name":
> "max-tolerance-component-count", "Value": "5" } ] } }, "ExternalDetails":
> null, "Hints": { "unorderedlist": [  ] }, "Timestamp": "Sun Apr 19 16:41:50
> PDT 2015", "DatasetId": { "int32":
> 13
> }
> , "PendingOp": { "int32":
> 0
> }
>  }
> , { "DataverseName"
> *...*
> *...*
> *...]*
>
> *With asynchronous query, handle key as expected.*
> $ curl -i -X GET '
> http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24ds%3B&mode=asynchronous'
> -H "Accept: application/json"
>
> HTTP/1.1 200 OK
> Content-Type: application/json;charset=utf-8
> Transfer-Encoding: chunked
> Server: Jetty(8.0.0.RC0)
>
> {"handle":[38,0]}
>
> *With erroneous query, error-code key as expected.*
> $ curl -i -X GET '
> http://localhost:19002/query?query=for+%24ds+in+dataset+Metadata.Dataset+return+%24error%3B'
> -H "Accept: application/json"
>
> HTTP/1.1 500 Server Error
> Content-Type: application/json;charset=utf-8
> Content-Length: 62
> Server: Jetty(8.0.0.RC0)
>
> {"error-code":[2,"SyntaxError: can't find variable $error\n"]}
>
> --
> You received this message because you are subscribed to the Google Groups
> "asterixdb-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to asterixdb-users+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>