-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit cd79543 Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Thu Jan 16 16:05:10 2025 -0500 feat: support reading tables via Unity Catalog provided credentials Signed-off-by: Stephen Carman <hntd187@users.noreply.github.com> commit 5a9ab33 Merge: 9551413 d6e1fbf Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Thu Jan 16 15:48:52 2025 -0500 Merge remote-tracking branch 'mine/unity-catalog-read' into unity-catalog-read # Conflicts: # crates/catalog-unity/Cargo.toml commit 9551413 Merge: ed8ac96 7f8b2ab Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Thu Jan 16 15:47:41 2025 -0500 feat: support reading tables via Unity Catalog provided credentials Signed-off-by: Stephen Carman <hntd187@users.noreply.github.com> commit d6e1fbf Merge: ed8ac96 7f8b2ab Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Thu Jan 16 15:47:41 2025 -0500 Merge remote-tracking branch 'mine/unity-catalog-read' into unity-catalog-read # Conflicts: # crates/catalog-unity/Cargo.toml commit ed8ac96 Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Sun Dec 22 12:34:42 2024 -0500 feat: support reading tables via Unity Catalog provided credentials Signed-off-by: Stephen Carman <hntd187@users.noreply.github.com> commit bb81a51 Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Sun Dec 22 12:34:42 2024 -0500 feat: support reading tables via Unity Catalog provided credentials Signed-off-by: Stephen Carman <hntd187@users.noreply.github.com> commit 17a9d1b Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Sun Dec 22 12:34:42 2024 -0500 feat: support reading tables via Unity Catalog provided credentials Signed-off-by: Stephen Carman <hntd187@users.noreply.github.com> commit 7f8b2ab Merge: 9a6e48e 24bbcdb Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Thu Dec 26 11:43:29 2024 -0500 Merge branch 'main' into unity-catalog-read commit 9a6e48e Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Sun Dec 22 12:34:42 2024 -0500 feat: support reading tables via Unity Catalog provided credentials Signed-off-by: Stephen Carman <hntd187@users.noreply.github.com> commit 1c3fe85 Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Sun Dec 22 12:34:42 2024 -0500 feat: support reading tables via Unity Catalog provided credentials Signed-off-by: Stephen Carman <hntd187@users.noreply.github.com> commit f7cc78b Author: Stephen Carman <hntd187@users.noreply.github.com> Date: Sun Dec 22 12:34:42 2024 -0500 feat: support reading tables via Unity Catalog provided credentials Signed-off-by: Stephen Carman <hntd187@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
546 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
use datafusion::prelude::*; | ||
use deltalake_catalog_unity::prelude::*; | ||
use std::error::Error; | ||
use std::sync::Arc; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn Error>> { | ||
let filter = tracing_subscriber::EnvFilter::builder().parse("deltalake_catalog_unity=info")?; | ||
let subscriber = tracing_subscriber::fmt() | ||
.pretty() | ||
.with_env_filter(filter) | ||
.finish(); | ||
tracing::subscriber::set_global_default(subscriber)?; | ||
|
||
let uc = UnityCatalogBuilder::from_env().build()?; | ||
|
||
deltalake_aws::register_handlers(None); | ||
|
||
let catalog = UnityCatalogProvider::try_new(Arc::new(uc), "scarman_sandbox").await?; | ||
let ctx = SessionContext::new(); | ||
ctx.register_catalog("scarman_sandbox", Arc::new(catalog)); | ||
|
||
ctx.sql( | ||
"select hdci.city_name, hdci.country_code, hdci.latitude, hdci.longitude from \ | ||
scarman_sandbox.external_data.historical_hourly_imperial hhi \ | ||
join scarman_sandbox.external_data.historical_daily_calendar_imperial hdci on hdci.country_code = hhi.country_code \ | ||
order by city_name \ | ||
limit 50;" | ||
) | ||
.await? | ||
.show() | ||
.await?; | ||
|
||
ctx.table("scarman_sandbox.external_data.historical_hourly_imperial") | ||
.await? | ||
.select(vec![ | ||
col("city_name"), | ||
col("country_code"), | ||
col("latitude"), | ||
col("longitude"), | ||
])? | ||
.show_limit(50) | ||
.await?; | ||
|
||
Ok(()) | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.