-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
370 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.DS_Store | ||
local-* | ||
/target | ||
Cargo.lock |
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
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,5 @@ | ||
{ | ||
"shareCredentialsVersion":1, | ||
"bearerToken":"<your Delta Share access token>", | ||
"endpoint":"<your Delta Share endpoinit URL>" | ||
} |
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,25 @@ | ||
#[tokio::main] | ||
async fn main() { | ||
|
||
use std::{fs}; | ||
|
||
env_logger::init(); | ||
|
||
println!("An example using an async client"); | ||
|
||
let conf_str = &fs::read_to_string("./config.json").unwrap(); | ||
let config: delta_sharing::protocol::ProviderConfig = serde_json::from_str(conf_str).expect("Invalid configuration"); | ||
let mut app = delta_sharing::application::Application::new(config, None).await.unwrap(); | ||
let shares = app.list_shares().await.unwrap(); | ||
if shares.len() == 0 { | ||
println!("At least 1 Delta Share is required"); | ||
} else { | ||
let tables = app.list_all_tables(&shares[0]).await.unwrap(); | ||
if shares.len() == 0 { | ||
println!("You need to have at least one table in share {}, or use a different share", shares[0].name); | ||
} else { | ||
let res = app.get_dataframe(&tables[0]).await.unwrap().collect().unwrap(); | ||
println!("Dataframe:\n {}", res); | ||
} | ||
} | ||
} |
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,25 @@ | ||
fn main() { | ||
|
||
use std::{fs}; | ||
|
||
env_logger::init(); | ||
|
||
println!("An example using a blocking client"); | ||
|
||
let conf_str = &fs::read_to_string("./config.json").unwrap(); | ||
|
||
let config: delta_sharing::protocol::ProviderConfig = serde_json::from_str(conf_str).expect("Invalid configuration"); | ||
let mut app = delta_sharing::blocking::Application::new(config, None).unwrap(); | ||
let shares = app.list_shares().unwrap(); | ||
if shares.len() == 0 { | ||
println!("At least 1 Delta Share is required"); | ||
} else { | ||
let tables = app.list_all_tables(&shares[0]).unwrap(); | ||
if shares.len() == 0 { | ||
println!("You need to have at least one table in share {}, or use a different share", shares[0].name); | ||
} else { | ||
let res = app.get_dataframe(&tables[0]).unwrap().collect().unwrap(); | ||
println!("Dataframe:\n {}", res); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.