0016-00000816

Updated at:

Problem description

The SelectObject request contains both the Range request header and the Range node in the XML request body.

Causes

You sent a SelectObject request that specifies both the Range request header and the <Range> node in the XML request body. The SelectObject operation does not support specifying a range in both the header and the request body simultaneously.

Examples

The SelectObject request includes a Range request header and specifies a query range in the <Range> node.

POST /oss-select/bigcsv_normal.csv?x-oss-process=csv%2Fselect HTTP/1.1
Date: Fri, 25 May 2018 22:11:39 GMT
Authorization: OSS qn6q**************:77Dv****************
Range: bytes=1024-2048
Host: BucketName.oss-cn-hangzhou.aliyuncs.com 
<?xml version="1.0"?>
<SelectRequest>
    <Expression>c2VsZWN0IGNvdW50KCopIGZyb20gb3Nzb2JqZWN0IHdoZXJlIF80ID4gNDU=
    </Expression>
    <InputSerialization>
         <CSV>
         		<Range>line-range=10-20</Range>
            <AllowQuotedRecordDelimiter>false</AllowQuotedRecordDelimiter>
         </CSV>
    </InputSerialization>
    <OutputSerialization>
        ......
    </OutputSerialization>
</SelectRequest>

Solutions

Specify the query range for the file in one of the following ways.

  • Provide the <Range> node in the XML request.

    POST /oss-select/bigcsv_normal.csv?x-oss-process=csv%2Fselect HTTP/1.1
    Date: Fri, 25 May 2018 22:11:39 GMT
    Authorization: OSS qn6q**************:77Dv****************
    Host: BucketName.oss-cn-hangzhou.aliyuncs.com 
    <?xml version="1.0"?>
    <SelectRequest>
        <Expression>c2VsZWN0IGNvdW50KCopIGZyb20gb3Nzb2JqZWN0IHdoZXJlIF80ID4gNDU=
        </Expression>
        <InputSerialization>
             <CSV>
             		<Range>line-range=10-20</Range>
             </CSV>
        </InputSerialization>
        <OutputSerialization>
            ......
        </OutputSerialization>
    </SelectRequest>

    When you use the Range parameter to query a file, include select meta. For more information, see CreateSelectObjectMeta.

  • Add the Range request header.

    If the target object is a CSV object, use the AllowQuotedRecordDelimiter parameter to specify whether the CSV content contains line feeds within quotation marks. If you set AllowQuotedRecordDelimiter to false, you can add the Range request header to the SelectObject request for more efficient sharded queries.

    POST /oss-select/bigcsv_normal.csv?x-oss-process=csv%2Fselect HTTP/1.1
    Date: Fri, 25 May 2018 22:11:39 GMT
    Authorization: OSS qn6q**************:77Dv****************
    Host: BucketName.oss-cn-hangzhou.aliyuncs.com 
    Range: bytes=1024-2048
    <?xml version="1.0"?>
    <SelectRequest>
        <Expression>c2VsZWN0IGNvdW50KCopIGZyb20gb3Nzb2JqZWN0IHdoZXJlIF80ID4gNDU=
        </Expression>
        <InputSerialization>
             <CSV>
             		<AllowQuotedRecordDelimiter>false</AllowQuotedRecordDelimiter>
             </CSV>
        </InputSerialization>
        <OutputSerialization>
            ......
        </OutputSerialization>
    </SelectRequest>

References