Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion datafusion-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ cargo run --example dataframe -- dataframe
| csv_json_opener | [`custom_data_source/csv_json_opener.rs`](examples/custom_data_source/csv_json_opener.rs) | Use low-level FileOpener APIs for CSV/JSON |
| csv_sql_streaming | [`custom_data_source/csv_sql_streaming.rs`](examples/custom_data_source/csv_sql_streaming.rs) | Run a streaming SQL query against CSV data |
| custom_datasource | [`custom_data_source/custom_datasource.rs`](examples/custom_data_source/custom_datasource.rs) | Query a custom TableProvider |
| custom_file_casts | [`custom_data_source/custom_file_casts.rs`](examples/custom_data_source/custom_file_casts.rs) | Implement custom casting rules |
| custom_file_format | [`custom_data_source/custom_file_format.rs`](examples/custom_data_source/custom_file_format.rs) | Write to a custom file format |
| default_column_values | [`custom_data_source/default_column_values.rs`](examples/custom_data_source/default_column_values.rs) | Custom default values using metadata |
| file_stream_provider | [`custom_data_source/file_stream_provider.rs`](examples/custom_data_source/file_stream_provider.rs) | Read/write via FileStreamProvider for streams |
Expand Down
212 changes: 0 additions & 212 deletions datafusion-examples/examples/custom_data_source/custom_file_casts.rs

This file was deleted.

10 changes: 1 addition & 9 deletions datafusion-examples/examples/custom_data_source/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//!
//! ## Usage
//! ```bash
//! cargo run --example custom_data_source -- [all|csv_json_opener|csv_sql_streaming|custom_datasource|custom_file_casts|custom_file_format|default_column_values|file_stream_provider]
//! cargo run --example custom_data_source -- [all|adapter_serialization|csv_json_opener|csv_sql_streaming|custom_datasource|custom_file_format|default_column_values|file_stream_provider]
//! ```
//!
//! Each subcommand runs a corresponding example:
Expand All @@ -39,9 +39,6 @@
//! - `custom_datasource`
//! (file: custom_datasource.rs, desc: Query a custom TableProvider)
//!
//! - `custom_file_casts`
//! (file: custom_file_casts.rs, desc: Implement custom casting rules)
//!
//! - `custom_file_format`
//! (file: custom_file_format.rs, desc: Write to a custom file format)
//!
Expand All @@ -55,7 +52,6 @@ mod adapter_serialization;
mod csv_json_opener;
mod csv_sql_streaming;
mod custom_datasource;
mod custom_file_casts;
mod custom_file_format;
mod default_column_values;
mod file_stream_provider;
Expand All @@ -72,7 +68,6 @@ enum ExampleKind {
CsvJsonOpener,
CsvSqlStreaming,
CustomDatasource,
CustomFileCasts,
CustomFileFormat,
DefaultColumnValues,
FileStreamProvider,
Expand Down Expand Up @@ -103,9 +98,6 @@ impl ExampleKind {
ExampleKind::CustomDatasource => {
custom_datasource::custom_datasource().await?
}
ExampleKind::CustomFileCasts => {
custom_file_casts::custom_file_casts().await?
}
ExampleKind::CustomFileFormat => {
custom_file_format::custom_file_format().await?
}
Expand Down
8 changes: 4 additions & 4 deletions datafusion/physical-expr-adapter/src/schema_rewriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ mod tests {
.expect("Expected CastExpr")
}

fn assert_cast_column(cast_expr: &CastExpr, name: &str, index: usize) {
fn assert_cast_input_column(cast_expr: &CastExpr, name: &str, index: usize) {
let inner_col = cast_expr
.expr()
.as_any()
Expand Down Expand Up @@ -771,7 +771,7 @@ mod tests {

let left_cast = assert_cast_expr(left.left());
assert_eq!(left_cast.target_field().data_type(), &DataType::Int64);
assert_cast_column(left_cast, "a", 0);
assert_cast_input_column(left_cast, "a", 0);

let right = outer
.right()
Expand Down Expand Up @@ -1672,7 +1672,7 @@ mod tests {
let cast_expr = assert_cast_expr(&result);

// Verify the inner column points to the correct physical index (1)
assert_cast_column(cast_expr, "a", 1);
assert_cast_input_column(cast_expr, "a", 1);

// Verify cast types
assert_eq!(
Expand All @@ -1692,7 +1692,7 @@ mod tests {
// Regression: this must still resolve against physical field `a` by name.
let rewritten = adapter.rewrite(Arc::new(Column::new("a", 0))).unwrap();
let cast_expr = assert_cast_expr(&rewritten);
assert_cast_column(cast_expr, "a", 1);
assert_cast_input_column(cast_expr, "a", 1);
assert_eq!(cast_expr.target_field().data_type(), &DataType::Int64);
}
}
Loading
Loading