This crate includes several examples of how to use various DataFusion APIs and help you on your way.
Run git submodule update --init to init test files.
To run the examples, use the cargo run command, such as:
git clone https://github.com/apache/arrow-datafusion
cd arrow-datafusion
# Download test data
git submodule update --init
# Run the `csv_sql` example:
# ... use the equivalent for other examples
cargo run --example csv_sqlavro_sql.rs: Build and run a query plan from a SQL statement against a local AVRO filecsv_sql.rs: Build and run a query plan from a SQL statement against a local CSV filecatalog.rs: Register the table into a custom catalogcustom_datasource.rs: Run queries against a custom datasource (TableProvider)dataframe.rs: Run a query using a DataFrame against a local parquet filedataframe-to-s3.rs: Run a query using a DataFrame against a parquet file from s3 and writing back to s3dataframe_output.rs: Examples of methods which write data out from a DataFramedataframe_in_memory.rs: Run a query using a DataFrame against data in memorydeserialize_to_struct.rs: Convert query results into rust structs using serdeexpr_api.rs: Create, execute, simplify and anaylzeExprsflight_sql_server.rs: Run DataFusion as a standalone process and execute SQL queries from JDBC clientsmemtable.rs: Create an query data in memory using SQL andRecordBatchesparquet_sql.rs: Build and run a query plan from a SQL statement against a local Parquet fileparquet_sql_multiple_files.rs: Build and run a query plan from a SQL statement against multiple local Parquet filesquery-aws-s3.rs: Configureobject_storeand run a query against files stored in AWS S3query-http-csv.rs: Configureobject_storeand run a query against files vi HTTPrewrite_expr.rs: Define and invoke a custom Query Optimizer passsimple_udf.rs: Define and invoke a User Defined Scalar Function (UDF)advanced_udf.rs: Define and invoke a more complicated User Defined Scalar Function (UDF)simple_udaf.rs: Define and invoke a User Defined Aggregate Function (UDAF)advanced_udaf.rs: Define and invoke a more complicated User Defined Aggregate Function (UDAF)simple_udfw.rs: Define and invoke a User Defined Window Function (UDWF)make_date.rs: Examples of using the make_date functionto_timestamp.rs: Examples of using the to_timestamp functionsadvanced_udwf.rs: Define and invoke a more complicated User Defined Window Function (UDWF)
flight_client.rsandflight_server.rs: Run DataFusion as a standalone process and execute SQL queries from a client using the Flight protocol.