Skip to content

Conversation

@steveloughran
Copy link
Contributor

@steveloughran steveloughran commented Jan 22, 2026

Addresses #15093

  • New (documented) option iceberg.hadoop.delete-trash-schemas
  • Default value is "hdfs, viewfs"
  • Uses Trash.moveToAppropriateTrash() to resolve the target FS, and will query hdfs for the
    active trash policy.
  • Restores behavior that delete(missing-path) is a no-op; trash operations raise FNFE here
  • Test changes as appropriate.

Doc changes are at the bottom of fileio.md
I added Adls gen2/abfs on the list of filesystems too, as it was missing & the code for it is there.

* declares whether to look @ trash policy before delete
* defaults are currently "hdfs" and "viewfs", though I'm tempted to make the
  default "".
… for

Addresses apache#15093
* Default Filesystems are hdfs: and viewfs: schemas
* Tests conditionally enable file: schema as trash
* Tests set up FS with/without trash enablement.
* Also address issue that delete(missing-path) must always succeed; trash policy fails here.
+ docs.
+ test sets in a list of schemas when enabling local trash so verifying that the option splitting works.
@steveloughran steveloughran marked this pull request as draft January 23, 2026 11:09
1. verify setting schemas to "" means default hdfs value goes
2. verify that a failure in moveToTrash() is caught and downgraded.

Test case apache#2 is the key one, as it shows that delete works even if trash move somehow failed.

+ fix doc trailing space failure.
@steveloughran
Copy link
Contributor Author

Interesting issue here: ~/.Trash gets big, though it'll need more investigation to make sure this isn't from interrupted tests.


/Users/stevel/.Trash/Current/var/folders/4n/w4cjr_d95kg9bxkl6sz3n3ym0000gr/T/junit-15134302652507541257/1000:
file--1002075424  file--133785895   file--1622163448  file--1980007042  file--410514615   file--754651889   file-1126302859   file-1514950078   file-185022233    file-322836703    file-660549861
file--1006745446  file--1345351436  file--162286093   file--1985261046  file--412082439   file--76298835    file-1133390126   file-1515750067   file-1859686204   file-324193398    file-665714142
file--1020709939  file--1348805784  file--1625192373  file--19857050    file--418414299   file--767909254   file-1146243483   file-1516128668   file-1864864574   file-328871087    file-670671589
file--1022376760  file--1351203833  file--1629625225  file--1987703832  file--419970352   file--768058561   file-1150886697   file-1521071863   file-186552093    file-336813414    file-674962237
file--1023753473  file--1356329072  file--1637576781  file--1987990915  file--421233404   file--772843413   file-1154434500   file-1539790064   file-1870335420   file-337278108    file-677018335
file--1028944107  file--1358487547  file--1645717849  file--1995556915  file--427159661   file--776399563   file-1155991450   file-1541870038   file-1873254330   file-340374188    file-684930505
...

file--1352213496  file--1706212471  file--2110360130  file--494713306   file--828416094   file-1165983380   file-1504357197   file-188634898    file-298113799    file-651799045

There's no way to set a different trash root; these will need cleaning up.

* the explicit trash tests clean up their trash paths; this verifies that
  attempts to delete under .Trash use delete() instead.
* user trash root is cleaned up after tests.
  Side issue: the path is always /user/$USER/.Trash, even on Linux local filesystems. Does that work reliably?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant