fix: reject unsupported DELETE LIMIT (#25005) ## Which issue does this PR close? - Part of #24998; this PR adds a safe rejection until bounded DELETE is implemented. ## Rationale for this change DELETE with LIMIT currently appears to plan successfully, but the table provider receives only the filters and deletes every matching row. Rejecting the unsupported clause prevents a bounded delete from silently becoming an unbounded one and matches the existing UPDATE LIMIT behavior. ## What changes are included in this PR? - reject DELETE LIMIT during SQL planning - remove the unreachable limit construction from delete_to_plan - replace the misleading EXPLAIN snapshots with error regressions, both with and without WHERE - directly cover both planner rejection branches in the SQL integration suite ## What is the testing strategy for this PR? - cargo test -p datafusion-sqllogictest --test sqllogictests -- delete - cargo test -p datafusion-sql --lib (88 passed) - cargo test -p datafusion-sql --test sql_integration plan_delete_rejects_limit (2 passed) - cargo clippy -p datafusion-sql --all-targets -- -D warnings - cargo fmt --all -- --check ## Are there any user-facing changes? Yes. DELETE statements containing LIMIT now return a not-implemented planning error instead of accepting the limit and potentially deleting every matching row. There is no public Rust API change. Implementation and validation were completed with AI coding assistance under the account owner’s direction. --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com> Co-authored-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
DataFusion is an extensible query engine written in Rust that uses Apache Arrow as its in-memory format.
This crate provides libraries and binaries for developers building fast and feature-rich database and analytic systems, customized for particular workloads. See use cases for examples. The following related subprojects target end users:
“Out of the box,” DataFusion offers SQL and DataFrame APIs, excellent performance, built-in support for CSV, Parquet, JSON, and Avro, extensive customization, and a great community.
DataFusion features a full query planner, a columnar, streaming, multi-threaded, vectorized execution engine, and partitioned data sources. You can customize DataFusion at almost all points including additional data sources, query languages, functions, custom operators and more. See the Architecture section for more details.
Here are links to important resources:
DataFusion is great for building projects such as domain-specific query engines, new database platforms and data pipelines, query languages and more. It lets you start quickly from a fully working engine, and then customize those features specific to your needs. See the list of known users.
Please see the contributor guide and communication pages for more information.
We discuss our roadmap via GitHub issues and invite you to join the conversation. The current discussion is the DataFusion 2026 Q3-Q4 Roadmap Discussion.
This crate has several features which can be specified in your Cargo.toml.
Default features:
nested_expressions: functions for working with nested types such as array_to_stringcompression: reading files compressed with xz2, bzip2, flate2, and zstdcrypto_expressions: cryptographic functions such as md5 and sha256datetime_expressions: date and time functions such as to_timestampencoding_expressions: encode and decode functionsparquet: support for reading the Apache Parquet formatsql: support for SQL parsing and planningregex_expressions: regular expression functions, such as regexp_matchunicode_expressions: include Unicode-aware functions such as character_lengthunparser: enables support to reverse LogicalPlans back into SQLrecursive_protection: uses recursive for stack overflow protection.Optional features:
avro: support for reading the Apache Avro formatbacktrace: include backtrace information in error messagesparquet_encryption: support for using Parquet Modular Encryptionserde: enable arrow-schema's serde featurePublic methods in Apache DataFusion evolve over time: while we try to maintain a stable API, we also improve the API over time. As a result, we typically deprecate methods before removing them, according to the deprecation guidelines.
Cargo.lockFollowing the guidance on committing Cargo.lock files, this project commits its Cargo.lock file.
CI uses the committed Cargo.lock file, and dependencies are updated regularly using Dependabot PRs.