Repository navigation
Commit 3c2cd09
authored
feat: allow COPY to be disabled independently (#25824)
## Which issue does this PR close?
- Closes #25823.
## Rationale for this change
Applications embedding DataFusion may want to allow DML operations such
as INSERT into registered table providers while disallowing COPY, which
writes query results to a file or object store. SQLOptions currently
controls COPY through allow_dml, so COPY cannot be disabled without also
disabling other DML.
## What changes are included in this PR?
- Add SQLOptions::with_allow_copy to control COPY independently,
defaulting to true.
- Keep with_allow_dml(false) behavior unchanged so it continues to
reject COPY.
- Add an integration test showing that disabling COPY does not disable
INSERT.
## What is the testing strategy for this PR?
- cargo fmt --all -- --check
- cargo clippy --all-targets --all-features -- -D warnings
- cargo test -p datafusion --test core_integration --
sql::sql_api::copy_can_be_disabled_independently_from_dml --exact
- cargo test -p datafusion --test core_integration --
sql::sql_api::unsupported_copy_returns_error --exact
## Are there any user-facing changes?
Yes. This adds the public SQLOptions::with_allow_copy builder method. It
is backwards compatible because COPY remains enabled by default and
with_allow_dml(false) continues to reject COPY.1 parent b5e5c0e commit 3c2cd09
2 files changed
Lines changed: 55 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2358 | 2358 | | |
2359 | 2359 | | |
2360 | 2360 | | |
| 2361 | + | |
| 2362 | + | |
2361 | 2363 | | |
2362 | 2364 | | |
2363 | 2365 | | |
| |||
2367 | 2369 | | |
2368 | 2370 | | |
2369 | 2371 | | |
| 2372 | + | |
2370 | 2373 | | |
2371 | 2374 | | |
2372 | 2375 | | |
| |||
2390 | 2393 | | |
2391 | 2394 | | |
2392 | 2395 | | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
2393 | 2405 | | |
2394 | 2406 | | |
2395 | 2407 | | |
| |||
2424 | 2436 | | |
2425 | 2437 | | |
2426 | 2438 | | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
2427 | 2442 | | |
2428 | 2443 | | |
2429 | 2444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
119 | 158 | | |
120 | 159 | | |
121 | 160 | | |
| |||
0 commit comments