Library User Guide

Table Constraint Enforcement

qianmoQqianmoQ· 更新于 2026-09-22· 阅读 3 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

Table Constraint Enforcement#

Table providers can describe table constraints using the TableConstraint and Constraints APIs. These constraints include primary keys, unique keys, foreign keys and check constraints.

DataFusion does not currently enforce these constraints at runtime. They are provided for informational purposes and can be used by custom TableProvider implementations or other parts of the system.

  • Nullability: The only property enforced by DataFusion is the nullability of each Field in a schema. Returning data with null values for Columns marked as not nullable will result in runtime errors during execution. DataFusion does not check or enforce nullability when data is ingested.
  • Primary and unique keys: DataFusion does not verify that the data satisfies primary or unique key constraints. Table providers that require this behaviour must implement their own checks.
  • Foreign keys and check constraints: These constraints are parsed but are not validated or used during query planning.

评论

登录后参与评论

正在加载评论…