类别:

系统函数 (系统信息)

SYSTEM$CLIENT_VERSION_INFO

返回 Snowflake 客户端和驱动程序的版本信息。

另请参阅:

客户端版本和支持策略

语法

SYSTEM$CLIENT_VERSION_INFO()
Copy

实参

返回

返回一个包含对象 JSON 数组的字符串。每个对象都包含有关特定客户端和驱动程序的信息,例如 SnowSQL、JDBC 驱动程序等。

每个 JSON 对象都包含以下名称/值对:

{
  "clientId": "DOTNETDriver",
  "clientAppId": ".NET",
  "minimumSupportedVersion": "2.0.9",
  "minimumNearingEndOfSupportVersion": "2.0.11",
  "recommendedVersion": "2.1.5",
  "deprecatedVersions": [],
  "_customSupportedVersions_": []
},
Copy

其中:

clientId

客户端或驱动程序的内部 ID。可能的值包括:

  • DOTNETDriver

  • GO

  • JDBC

  • JSDriver

  • ODBC

  • PHP_PDO

  • PythonConnector

  • SnowSQL

  • SQLAPI

clientAppId

客户端或驱动程序的名称。可能的值包括:

  • .NET

  • GO

  • JDBC

  • JavaScript

  • ODBC

  • PDO

  • PythonConnector

  • SnowSQL

  • SQLAPI

minimumSupportedVersion

官方支持的最早版本的客户端或驱动程序。

minimumNearingEndOfSupportVersion

在下一季度初达到支持终止日期 (EOS) 的客户端或驱动程序的版本。

recommendedVersion

客户端或驱动程序的当前版本。

deprecatedVersions_customSupportedVersions_

仅供内部使用。

使用说明

  • 如果您不想处理 JSON,则可以使用 PARSE_JSONLATERAL FLATTEN 函数,将 JSON 转换为列式输出。

  • 您也可以使用 WHERE 子句返回特定客户端或驱动程序的信息 (clientId)。

示例

以下示例会检索所有 Snowflake 客户端和驱动程序的版本信息。请注意,为了提高可读性,输出已手动格式化。

SELECT SYSTEM$CLIENT_VERSION_INFO();
Copy
[
  {
    "clientId": "DOTNETDriver",
    "clientAppId": ".NET",
    "minimumSupportedVersion": "2.0.9",
    "minimumNearingEndOfSupportVersion": "2.0.11",
    "recommendedVersion": "2.1.5",
    "deprecatedVersions": [],
    "_customSupportedVersions_": []
  },
  {
    "clientId": "GO",
    "clientAppId": "Go",
    "minimumSupportedVersion": "1.6.6",
    "minimumNearingEndOfSupportVersion": "1.6.9",
    "recommendedVersion": "1.7.1",
    "deprecatedVersions": [],
    "_customSupportedVersions_": [
      "1.1.5"
    ]
  },
  {
    "clientId": "JDBC",
    "clientAppId": "JDBC",
    "minimumSupportedVersion": "3.13.14",
    "minimumNearingEndOfSupportVersion": "3.13.18",
    "recommendedVersion": "3.14.4",
    "deprecatedVersions": [],
    "_customSupportedVersions_": []
  },
  {
    "clientId": "JSDriver",
    "clientAppId": "JavaScript",
    "minimumSupportedVersion": "1.6.6",
    "minimumNearingEndOfSupportVersion": "1.6.9",
    "recommendedVersion": "1.9.2",
    "deprecatedVersions": [],
    "_customSupportedVersions_": []
  },
  {
    "clientId": "ODBC",
    "clientAppId": "ODBC",
    "minimumSupportedVersion": "2.24.5",
    "minimumNearingEndOfSupportVersion": "2.24.7",
    "recommendedVersion": "3.1.4",
    "deprecatedVersions": [],
    "_customSupportedVersions_": []
  },
  {
    "clientId": "PHP_PDO",
    "clientAppId": "PDO",
    "minimumSupportedVersion": "1.2.0",
    "minimumNearingEndOfSupportVersion": "1.2.1",
    "recommendedVersion": "2.0.1",
    "deprecatedVersions": [],
    "_customSupportedVersions_": []
  },
  {
    "clientId": "PythonConnector",
    "clientAppId": "PythonConnector",
    "minimumSupportedVersion": "2.7.3",
    "minimumNearingEndOfSupportVersion": "2.7.7",
    "recommendedVersion": "3.6.0",
    "deprecatedVersions": [],
    "_customSupportedVersions_": []
  },
  {
    "clientId": "SnowSQL",
    "clientAppId": "SnowSQL",
    "minimumSupportedVersion": "1.2.21",
    "minimumNearingEndOfSupportVersion": "1.2.21",
    "recommendedVersion": "1.2.31",
    "deprecatedVersions": [],
    "_customSupportedVersions_": []
  },
  {
    "clientId": "SQLAPI",
    "clientAppId": "SQLAPI",
    "minimumSupportedVersion": "1.0.0",
    "minimumNearingEndOfSupportVersion": "",
    "recommendedVersion": "",
    "deprecatedVersions": [],
    "_customSupportedVersions_": []
  }
]

以下示例以行集的形式返回所有客户端的版本信息:

WITH output AS (
  SELECT
    PARSE_JSON(SYSTEM$CLIENT_VERSION_INFO()) a
)
SELECT
    value:clientAppId::STRING AS client_app_id,
    value:minimumSupportedVersion::STRING AS minimum_version,
    value:minimumNearingEndOfSupportVersion::STRING AS near_end_of_support_version,
    value:recommendedVersion::STRING AS recommended_version
  FROM output r,
    LATERAL FLATTEN(INPUT => r.a, MODE =>'array');
Copy
+-----------------+-----------------+-----------------------------+---------------------+
| CLIENT_APP_ID   | MINIMUM_VERSION | NEAR_END_OF_SUPPORT_VERSION | RECOMMENDED_VERSION |
|-----------------+-----------------+-----------------------------+---------------------|
| .NET            | 2.0.9           | 2.0.11                      | 2.1.5               |
| Go              | 1.6.6           | 1.6.9                       | 1.7.1               |
| JDBC            | 3.13.14         | 3.13.18                     | 3.14.4              |
| JavaScript      | 1.6.6           | 1.6.9                       | 1.9.2               |
| ODBC            | 2.23.5          | 2.24.7                      | 3.1.4               |
| PDO             | 1.2.0           | 1.2.1                       | 2.0.1               |
| PythonConnector | 2.7.3           | 2.7.7                       | 3.6.0               |
| SnowSQL         | 1.2.21          | 1.2.21                      | 1.2.31              |
| SQLAPI          | 1.0.0           |                             |                     |
+-----------------+-----------------+-----------------------------+---------------------+

以下示例以行集的形式返回 JDBC 驱动程序的版本信息:

WITH output AS (
  SELECT
    PARSE_JSON(SYSTEM$CLIENT_VERSION_INFO()) a
)
SELECT
    value:clientId::STRING AS client_id,
    value:minimumSupportedVersion::STRING AS minimum_version,
    value:minimumNearingEndOfSupportVersion::STRING AS near_end_of_support_version,
    value:recommendedVersion::STRING AS recommended_version
  FROM output r,
    LATERAL FLATTEN(INPUT => r.a, MODE =>'array')
  WHERE client_id = 'JDBC';
Copy
+-----------+-----------------+-----------------------------+---------------------+
| CLIENT_ID | MINIMUM_VERSION | NEAR_END_OF_SUPPORT_VERSION | RECOMMENDED_VERSION |
|-----------+-----------------+-----------------------------+---------------------|
| JDBC      | 3.13.14         | 3.13.18                     | 3.14.4              |
+-----------+-----------------+-----------------------------+---------------------+
语言: 中文