use std::{collections::HashMap, sync::Arc}; use datafusion::{prelude::SessionContext, sql::TableReference}; use datafusion_table_providers::{ mysql::MySQLTableFactory, sql::db_connection_pool::mysqlpool::MySQLConnectionPool, util::secrets::to_secret_map, }; /// This example demonstrates how to register a table provider into DataFusion that /// uses a MySQL table as its source. /// /// Use docker to start a MySQL server this example can connect to: /// /// ```bash /// docker run --name mysql -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=mysql_db -p 3306:3306 -d mysql:9.0 /// # Wait for the MySQL server to start /// sleep 30 /// /// # Create a table in the MySQL server and insert some data /// docker exec -i mysql mysql -uroot -ppassword mysql_db <