0016-00000839

Updated at:

Problem description

SelectObject returns an error when you set <Type> to DOCUMENT and include a <Range> element in the same request. JSON DOCUMENT type does not support range queries.

Causes

You initiated a SelectObject request in which the <Type> element specifies the JSON object type as DOCUMENT and the <Range> element specifies the range of the object to query. The DOCUMENT type does not support range queries.

Examples

The following request fails because <Type>DOCUMENT</Type> and <Range>line-range=10-20</Range> cannot be used together.

POST /oss-select/sample_json.json?x-oss-process=json%2Fselect HTTP/1.1
Host: host name
date: Mon, 10 Dec 2018 18:28:11 GMT
authorization: OSS AccessKeySignature
Content-Length: 317
<SelectRequest>
    <Expression>c2VsZWN0ICogZnJvbSBvc3NvYmplY3Qub2JqZWN0c1sqXSB3aGVyZSBwYXJ0eSA9ICdEZW1vY3JhdCc=
    </Expression>
    <InputSerialization>
    <JSON>
        <Type>DOCUMENT</Type>
        <Range>line-range=10-20</Range>
    </JSON>
    </InputSerialization>
    <OutputSerialization>
    <JSON>
        <RecordDelimiter>LA==</RecordDelimiter>
    </JSON>
    </OutputSerialization>
    <Options />
</SelectRequest>

Solutions

Remove the <Range> element, or change the object format to one that supports range queries:

  • CSV — range queries are supported.

  • JSON with <Type>LINES</Type> — range queries are supported.

References