Commit 3272ebe
authored
refactor: move ListingTable over to the catalog-listing-table crate (apache#18080)
## Which issue does this PR close?
- This addresses part of
apache#17713
- Closes apache#14462
## Rationale for this change
In order to remove the `datafusion` core crate from `proto` as a
dependency, we need to access `ListingTable` but it is within the `core`
crate. There already exists a `datafusion-catalog-listing` which is bare
and appears to be the place this should exist.
## What changes are included in this PR?
Move `ListingTable` and some of its dependent structs over to the
`datafusion-catalog-listing` crate.
There is one dependency I wasn't able to remove from the `core` crate,
which is inferring the listing table configuration options. That is
because within this method it downcasts `Session` to `SessionState`. If
a downstream user ever attempts to implement `Session` themselves, these
methods also would not work. Because it would cause a circular
dependency, we cannot also lift the method we need out of `SessionState`
to `Session`. Instead I took the approach of splitting off the two
methods that require `SessionState` as an extension trait for the
listing table config.
From the git diff this appears to be a large change (+1637/-1519)
however the *vast* majority of that is copying the code from one file
into another. I have added a comment on the significant change.
## Are these changes tested?
Existing unit tests show no regression. This is just a code refactor.
## Are there any user-facing changes?
Users may need to update their use paths.1 parent fe95505 commit 3272ebe
13 files changed
Lines changed: 1657 additions & 1528 deletions
File tree
- datafusion-examples/examples
- datafusion
- catalog-listing
- src
- core
- src/datasource
- listing
- tests
- catalog
- parquet
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments