martin-g commented on code in PR #18946:
URL: https://github.com/apache/datafusion/pull/18946#discussion_r2567388735
##########
datafusion-examples/examples/custom_data_source/main.rs:
##########
Review Comment:
```suggestion
FileStreamProvider,
```
##########
datafusion-examples/examples/custom_data_source/main.rs:
##########
Review Comment:
```suggestion
Self::FileStreamProvider => "file_stream_provider",
```
##########
datafusion-examples/examples/custom_data_source/main.rs:
##########
Review Comment:
```suggestion
"file_stream_provider" => Ok(Self::FileStreamProvider),
```
##########
datafusion-examples/examples/udf/main.rs:
##########
Review Comment:
```suggestion
Self::Udwf => "udwf",
```
##########
datafusion-examples/examples/custom_data_source/main.rs:
##########
@@ -100,7 +115,36 @@ impl ExampleKind {
const EXAMPLE_NAME: &str = "custom_data_source";
fn variants() -> Vec<&'static str> {
- Self::ALL.iter().map(|x| x.as_ref()).collect()
+ Self::ALL_VARIANTS
+ .iter()
+ .map(|example| example.as_ref())
+ .collect()
+ }
+
+ async fn run(&self) -> Result<()> {
+ match self {
+ ExampleKind::CsvJsonOpener =>
csv_json_opener::csv_json_opener().await?,
+ ExampleKind::CsvSqlStreaming => {
+ csv_sql_streaming::csv_sql_streaming().await?
+ }
+ 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?
+ }
+ ExampleKind::DefaultColumnValues => {
+ default_column_values::default_column_values().await?
+ }
+ ExampleKind::FileFtreamProvider => {
Review Comment:
```suggestion
ExampleKind::FileStreamProvider => {
```
##########
ci/scripts/rust_example.sh:
##########
@@ -25,12 +25,26 @@ export CARGO_PROFILE_CI_STRIP=true
cd datafusion-examples/examples/
cargo build --profile ci --examples
-files=$(ls .)
-for filename in $files
-do
- example_name=`basename $filename ".rs"`
- # Skip tests that rely on external storage and flight
- if [ ! -d $filename ]; then
- cargo run --profile ci --example $example_name
- fi
+SKIP_LIST=("external_dependency" "flight" "ffi")
+
+skip_example() {
+ local name="$1"
+ for skip in "${SKIP_LIST[@]}"; do
+ if [ "$name" = "$skip" ]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+for dir in */; do
+ example_name=$(basename "$dir")
+
+ if skip_example "$example_name"; then
+ echo "Skipping $example_name"
+ continue
+ fi
+
+ echo "Running example group: $example_name"
+ cargo run --profile ci --example "$example_name" all
Review Comment:
```suggestion
cargo run --profile ci --example "$example_name" -- all
```
without ` -- ` `all` will be passed as an argument to `cargo`, no ?
##########
datafusion-examples/examples/custom_data_source/main.rs:
##########
Review Comment:
```suggestion
Self::FileStreamProvider,
```
##########
datafusion-examples/examples/custom_data_source/main.rs:
##########
@@ -87,7 +91,18 @@ impl FromStr for ExampleKind {
}
impl ExampleKind {
- const ALL: [Self; 7] = [
+ const ALL_VARIANTS: [Self; 8] = [
+ Self::All,
+ Self::CsvJsonOpener,
+ Self::CsvSqlStreaming,
+ Self::CustomDatasource,
+ Self::CustomFileCasts,
+ Self::CustomFileFormat,
+ Self::DefaultColumnValues,
+ Self::FileFtreamProvider,
Review Comment:
```suggestion
Self::FileStreamProvider,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]