Skip to content

Commit 5ff21ae

Browse files
authored
Merge branch 'main' into fix-is-not-null-proto-hooks
2 parents 811e6da + 04c01bb commit 5ff21ae

80 files changed

Lines changed: 4937 additions & 646 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
steps:
4646
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4747
- name: Install cargo-audit
48-
uses: taiki-e/install-action@213ccc1a076163c093f914550b94feb90fab916d # v2.79.2
48+
uses: taiki-e/install-action@920ab1831fbf4fb3ef75c8ead83556c918bb7290 # v2.79.8
4949
with:
5050
tool: cargo-audit
5151
- name: Run audit check

.github/workflows/breaking_changes_detector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
9090
- name: Install cargo-semver-checks
9191
if: steps.changed_crates.outputs.packages != ''
92-
uses: taiki-e/install-action@213ccc1a076163c093f914550b94feb90fab916d # v2.79.2
92+
uses: taiki-e/install-action@920ab1831fbf4fb3ef75c8ead83556c918bb7290 # v2.79.8
9393
with:
9494
tool: cargo-semver-checks
9595

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ jobs:
4545
persist-credentials: false
4646

4747
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4
48+
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4
4949
with:
5050
languages: actions
5151

5252
- name: Perform CodeQL Analysis
53-
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4
53+
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4
5454
with:
5555
category: "/language:actions"

.github/workflows/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
source ci/scripts/utils/tool_versions.sh
6565
echo "LYCHEE_VERSION=${LYCHEE_VERSION}" >> "$GITHUB_ENV"
6666
- name: Install lychee
67-
uses: taiki-e/install-action@213ccc1a076163c093f914550b94feb90fab916d # v2.79.2
67+
uses: taiki-e/install-action@920ab1831fbf4fb3ef75c8ead83556c918bb7290 # v2.79.8
6868
with:
6969
tool: lychee@${{ env.LYCHEE_VERSION }}
7070
- name: Run markdown link check

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ jobs:
429429
sudo apt-get update -qq
430430
sudo apt-get install -y -qq clang
431431
- name: Setup wasm-pack
432-
uses: taiki-e/install-action@213ccc1a076163c093f914550b94feb90fab916d # v2.79.2
432+
uses: taiki-e/install-action@920ab1831fbf4fb3ef75c8ead83556c918bb7290 # v2.79.8
433433
with:
434434
tool: wasm-pack
435435
- name: Run tests with headless mode
@@ -773,7 +773,7 @@ jobs:
773773
- name: Setup Rust toolchain
774774
uses: ./.github/actions/setup-builder
775775
- name: Install cargo-msrv
776-
uses: taiki-e/install-action@213ccc1a076163c093f914550b94feb90fab916d # v2.79.2
776+
uses: taiki-e/install-action@920ab1831fbf4fb3ef75c8ead83556c918bb7290 # v2.79.8
777777
with:
778778
tool: cargo-msrv
779779

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
issues: write
2929
pull-requests: write
3030
steps:
31-
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
31+
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
3232
with:
3333
stale-pr-message: "Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days."
3434
days-before-pr-stale: 60

Cargo.lock

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/catalog-listing/src/table.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use datafusion_datasource::file_sink_config::{FileOutputMode, FileSinkConfig};
3232
#[expect(deprecated)]
3333
use datafusion_datasource::schema_adapter::SchemaAdapterFactory;
3434
use datafusion_datasource::{
35-
ListingTableUrl, PartitionedFile, TableSchema, compute_all_files_statistics,
35+
ListingTableUrl, PartitionedFile, TableSchemaBuilder, compute_all_files_statistics,
3636
};
3737
use datafusion_execution::cache::TableScopedPath;
3838
use datafusion_execution::cache::cache_manager::FileStatisticsCache;
@@ -321,14 +321,15 @@ impl ListingTable {
321321

322322
/// Creates a file source for this table
323323
fn create_file_source(&self) -> Arc<dyn FileSource> {
324-
let table_schema = TableSchema::new(
325-
Arc::clone(&self.file_schema),
326-
self.options
327-
.table_partition_cols
328-
.iter()
329-
.map(|(col, field)| Arc::new(Field::new(col, field.clone(), false)))
330-
.collect(),
331-
);
324+
let table_schema = TableSchemaBuilder::from(&self.file_schema)
325+
.with_table_partition_cols(
326+
self.options
327+
.table_partition_cols
328+
.iter()
329+
.map(|(col, field)| Arc::new(Field::new(col, field.clone(), false)))
330+
.collect::<Vec<_>>(),
331+
)
332+
.build();
332333

333334
self.options.format.file_source(table_schema)
334335
}

datafusion/catalog/src/table.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use async_trait::async_trait;
2626
use datafusion_common::{Constraints, Statistics, not_impl_err};
2727
use datafusion_common::{Result, internal_err};
2828
use datafusion_expr::Expr;
29+
use datafusion_expr::statistics::StatisticsRequest;
2930

3031
use datafusion_expr::dml::InsertOp;
3132
use datafusion_expr::{
@@ -406,6 +407,7 @@ pub struct ScanArgs<'a> {
406407
filters: Option<&'a [Expr]>,
407408
projection: Option<&'a [usize]>,
408409
limit: Option<usize>,
410+
statistics_requests: &'a [StatisticsRequest],
409411
}
410412

411413
impl<'a> ScanArgs<'a> {
@@ -467,6 +469,32 @@ impl<'a> ScanArgs<'a> {
467469
pub fn limit(&self) -> Option<usize> {
468470
self.limit
469471
}
472+
473+
/// Specifies the statistics the caller may use when optimizing the query.
474+
///
475+
/// This is intended to allow the `TableProvider` to cheaply provide
476+
/// statistics that may help, such as those it has in an in-memory catalog
477+
/// or from some other metadata source.
478+
///
479+
/// `TableProvider`s read these via [`Self::statistics_requests()`]; anything
480+
/// a `TableProvider` cannot answer cheaply it simply ignores. DataFusion's
481+
/// own `TableProvider`s ignore this field — it exists so a request can be
482+
/// threaded from a custom optimizer rule (which annotates
483+
/// `TableScan::statistics_requests`) through to a custom `TableProvider`.
484+
pub fn with_statistics_requests(
485+
mut self,
486+
statistics_requests: &'a [StatisticsRequest],
487+
) -> Self {
488+
self.statistics_requests = statistics_requests;
489+
self
490+
}
491+
492+
/// Get the statistics requests for the scan. Empty if none were set.
493+
///
494+
/// See [`Self::with_statistics_requests`] for more details
495+
pub fn statistics_requests(&self) -> &'a [StatisticsRequest] {
496+
self.statistics_requests
497+
}
470498
}
471499

472500
/// Result of a table scan operation from [`TableProvider::scan_with_args`].

datafusion/core/src/datasource/file_format/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub(crate) mod test_util {
6767
.await?
6868
};
6969

70-
let table_schema = TableSchema::new(file_schema.clone(), vec![]);
70+
let table_schema = TableSchema::from(&file_schema);
7171

7272
let statistics = format
7373
.infer_stats(state, &store, file_schema.clone(), &meta)

0 commit comments

Comments
 (0)