Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rust] Datafusion Catalog Support #429

Merged
merged 11 commits into from
Jan 26, 2024
Merged

Conversation

mag1c1an1
Copy link
Contributor

@mag1c1an1 mag1c1an1 commented Jan 20, 2024

Close #424
Due to the restriction of datafusion's api, CREATE EXTERNAL TABLE ... is not supported.
Supported SQL: CREATE SCHEMA;DROP TABLE;SELECT ... ;SHOW TABLES;SHOW COLUMNS

@mag1c1an1 mag1c1an1 force-pushed the catalog branch 2 times, most recently from 3111d2d to 3fb49c0 Compare January 20, 2024 18:36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary indent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed by applying rustfmt

let np = Namespace {
namespace: "default".to_string(),
properties: serde_json::to_string(&LakeSoulTableProperty {
hash_bucket_num: Some(4),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hash_bucket_num is a table property.



#[test_log::test]
fn simple_sql_test() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be more SQL tests.

@@ -0,0 +1,386 @@
mod catalog_tests {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-right info is required.

use std::collections::HashMap;
use std::sync::Arc;

use std::sync::{Arc};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary bracket.



/// A metadata wrapper
pub struct LakeSoulCatalog {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LakeSoulCatalog and LakeSoulNamespce can be separated from mod.rs.

@@ -33,11 +33,12 @@ hdrs = { git = "https://github.com/lakesoul-io/hdrs.git", branch = "main", featu
lazy_static = "1.4.0"
chrono = "0.4"
serde_json = { workspace = true }
log = { workspace = true }
tracing = {version = "0.1.40"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tracing = "0.1.40"

Signed-off-by: mag1c1an1 <[email protected]>
Signed-off-by: mag1c1an1 <[email protected]>
Signed-off-by: mag1c1an1 <[email protected]>
Signed-off-by: mag1c1an1 <[email protected]>
Signed-off-by: mag1c1an1 <[email protected]>
Signed-off-by: mag1c1an1 <[email protected]>
Signed-off-by: mag1c1an1 <[email protected]>
Signed-off-by: mag1c1an1 <[email protected]>
Signed-off-by: mag1c1an1 <[email protected]>
@xuchen-plus xuchen-plus changed the title [Rust] Datafusion Catalog Support (#issue 424) [Rust] Datafusion Catalog Support Jan 24, 2024
@xuchen-plus xuchen-plus added enhancement New feature or request native-io labels Jan 24, 2024
Signed-off-by: mag1c1an1 <[email protected]>
&self,
name: &str,
schema: Arc<dyn SchemaProvider>,
) -> lakesoul_io::lakesoul_io_config::Result<Option<Arc<dyn SchemaProvider>>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use datafusion::error::Result

@@ -89,7 +104,7 @@ impl MetaDataClient {
}

async fn execute_insert(&self, insert_type: i32, wrapper: JniWrapper) -> Result<i32> {
for times in 0..self.max_retry {
for times in 0..self.max_retry as i64 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why i64

@Ceng23333 Ceng23333 merged commit 70f4248 into lakesoul-io:main Jan 26, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request native-io
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Rust] DataFusion Catalog Support
3 participants