0016-00000815

Updated at:

Problem description

The Range request header is not supported in SelectObject requests.

Problem cause

You sent a SelectObject request that includes the Range request header. The SelectObject operation does not support this header.

Examples

The SelectObject request contains the unsupported Range request header.

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>
         ......
    </InputSerialization>
    <OutputSerialization>
        ......
    </OutputSerialization>
</SelectRequest>

Solutions

Delete the Range request header from the request.

If you want to specify a query range for the file, you can provide a Range node in the XML request body. The node supports the following two formats:

  • Query by row: line-range=start-end. For example, line-range=10-20 scans from row 10 to row 20.

  • Query by split: split-range=start-end. For example, split-range=10-20 scans from split 10 to split 20.

The start and end values are inclusive. For example:

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>

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

Additionally, if the target object is a CSV file, you can use the AllowQuotedRecordDelimiter parameter to specify whether the CSV content contains line feeds within quotation marks. When the AllowQuotedRecordDelimiter parameter is set to false, SelectObject supports adding the Range request header to perform more efficient sharded queries.

References