排查 Delta Sharing 中的常见共享问题

以下部分介绍了在尝试访问共享中的数据时可能发生的常见错误。

超出资源限制错误

问题:对共享表的查询返回错误

  • "RESOURCE_LIMIT_EXCEEDED","message":"The table metadata size exceeded limits"
  • "RESOURCE_LIMIT_EXCEEDED","message":"The number of files in the table to return exceeded limits, consider contact your provider to optimize the table"

可能的原因:对于共享表,元数据中允许的文件数量存在限制。

建议的解决方法:若要了解如何解决其中任何一个问题,请参阅 Databricks 知识库中的查询 Delta Sharing 表时出现 RESOURCE_LIMIT_EXCEEDED 错误

清空数据文件问题

问题:你会看到一条引发“404 指定的 [path|key] 不存在”异常的错误消息。

Spark 错误示例:

java.lang.Throwable: HTTP request failed with status: HTTP/1.1 404 The specified path does not exist.

HTTP request failed with status: HTTP/1.1 404 Not Found <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message>

可能的原因:通常情况下,出现此错误是由于与预签名 URL 相对应的数据文件在共享表中清空,而该数据文件属于历史表版本。

解决方法:查询最新快照。

开源 Spark 的架构不匹配错误

问题:使用开源 Spark(OSS)时,读取增量共享表时会出现架构不匹配错误。

错误示例::

py4j.protocol.Py4JJavaError: An error occurred while calling o85.count.: org.apache.spark.SparkException: The schema or partition columns of your Delta table has changed since your DataFrame was created. Please redefine your DataFrame

可能的原因:创建 DataFrame 后,Delta 表的架构或分区列已更改。

建议的修复:将 Spark 配置标志 spark.delta.sharing.client.useStructuralSchemaMatch 设置为 true

spark.conf.set("spark.delta.sharing.client.useStructuralSchemaMatch", "true")

存储网络配置问题

问题:你会看到一条引发 SSLCertVerificationError 的错误消息。

Spark 错误示例:

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

可能的原因:通常情况下,出现此错误是由于共享表或卷的存储位置存在网络限制。

建议的修复方法:在存储提供程序接口中允许访问该存储位置,方法是在存储帐户防火墙设置中允许客户端 IP。

共享实现资产访问问题

问题:对共享视图、具体化视图或流式处理表的查询返回错误 DS_MATERIALIZATION_QUERY_FAILED

"DS_MATERIALIZATION_QUERY_FAILED": "The shared asset could not be materialized due to the asset not being accessible in the materialization workspace. Please ask data provider to contact :re[DB] support to override the materialization workspace."

可能的原因:提供程序对尝试共享的资产没有读写访问权限。

建议的修复:请联系数据提供程序,确保他们具有对共享数据资产的读写访问权限。

数据实体化期间的网络访问错误

问题:对共享数据资产的查询返回有关访问数据提供程序云存储的错误。

There was an issue accessing the data provider's cloud storage. Shared view materialization uses the Serverless compute of data provider's region to perform the materialization. Please contact the data provider to allowlist Serverless compute IPs of their corresponding region to access the view's dependent tables storage location.

可能的原因:具体化数据的存储位置存在网络限制(例如防火墙或专用链接),以防止 Azure Databricks 无服务器计算访问它。 共享视图、具体化视图或流式处理表时,数据将暂时在提供程序端进行具体化处理。 具体化存储位置是资产的父架构或目录存储位置。

建议的修复:数据提供程序需要允许列出其相应区域的无服务器计算 IP 才能访问视图的依赖表存储位置。 若要配置防火墙,请参阅 配置用于无服务器计算访问的防火墙