已弃用的功能

本主题介绍了 Snowflake 版本 5.40 中已弃用的 Snowflake SQL API 功能。

See the Snowflake SQL API for information on the current behavior of the SQL API.

使用已弃用的 SQL API 功能

The current version of the SQL API is enabled by default. To access the deprecated version, use the following endpoints:

端点描述
/api/statements/使用此端点提交要执行的 SQL 语句。
/api/statements/statementHandleUse this endpoint to check the status of the execution of a statement. (statementHandle is a unique identifier for the statement submitted for execution.)
/api/statements/statementHandle/cancel使用此端点取消执行语句。

Note

这些端点不再受支持,仅用于向后兼容。未来的版本中会禁用这些端点。

已更改和弃用的功能

When using the deprecated SQL API functionality, if you set the pageSize request parameter to paginate the results, Snowflake returns the first page of results in the response. You can use the numPages field in the ResultSet_resultSetMetaData object in the ResultSet object to determine the total number of pages of results.

To get the next page of results or other pages of results, use the URLs provided in the Link header in the HTTP response. The Link header specifies the URLs for retrieving the first, next, previous, and last page of the results

以下功能已更改或弃用:

  • You can specify the nullable parameter in both GET and POST requests.
  • Use the pageSize parameter to specify the number of rows returned by a query. The page size can range from the minimum supported number (10) to the maximum supported number (10000) of rows per page. By default, the number of rows returned varies, depending on the execution of the statement.
  • You use the page to identify which page of results to return. The number can range from 0 to the total number of pages minus 1.
  • 默认情况下,行号作为数据集的一部分返回。

确定结果集页面大小是否超过限制

SQL API 中已弃用的功能最大可以返回约为 10 MB 的结果集页面。

If the result set page exceeds this size, the endpoint returns an HTTP 200 response with a truncated result set in the body and the code field set to 391908:

HTTP/1.1 200 OK
...
{
  "code": "391908",
  ...
}

If this occurs, send the request again with the pageSize parameter set to a smaller value that fits within the maximum size of a page.