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] refactor with SplitDescArray #470

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.alibaba.fastjson.annotation.JSONField;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.hadoop.util.hash.Hash;

import java.util.HashMap;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ object RandomStringGenerator {
val random = new Random()

def generateRandomString(length: Int): String = {
val chars = ('a' to 'z') ++ ('A' to 'Z') ++ ('0' to '9')
val chars = ('a' to 'z') ++ ('0' to '9')
val sb = new StringBuilder
for (_ <- 1 to length) {
val randomIndex = random.nextInt(chars.length)
Expand Down
166 changes: 76 additions & 90 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ futures = "0.3"
url = "2.2"
async-trait = "0.1"
serde_json = "1.0"
log = "^0.4"
prost = "0.12.3"
prost-build = "0.12.3"
uuid = { version = "1.4.0", features = ["v4", "fast-rng", "macro-diagnostics"] }
serde = { version = "1.0", features = ["derive", "std", "rc"] }
rand = "^0.8"
bytes = "1.4.0"
half = "^2.1"
tracing = "0.1.40"
thiserror = "1.0"
anyhow = "1.0.79"
anyhow = "1.0.79"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "local-time"] }
time = { version = "0.3.34", features = ["macros"] }
time-macros = { version = "0.2.17" }
3 changes: 2 additions & 1 deletion rust/lakesoul-datafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ serde_json = { workspace = true }
tokio = { workspace = true }
rand = { workspace = true }
bytes = { workspace = true }
tracing = "0.1.40"
tracing = { workspace = true }
thiserror = { workspace = true }
anyhow = { workspace = true }
url = { workspace = true }
Expand All @@ -41,6 +41,7 @@ ctor = "0.2"
test-log = { version = "0.2.14", features = ["trace"] }
rand = "0.8.5"
rand_chacha = "0.3.1"
tracing-subscriber = {workspace = true}

[features]
ci = []
16 changes: 10 additions & 6 deletions rust/lakesoul-datafusion/src/catalog/lakesoul_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
//
// SPDX-License-Identifier: Apache-2.0

use crate::catalog::LakeSoulNamespace;
use datafusion::catalog::schema::SchemaProvider;
use std::any::Any;
use std::fmt::{Debug, Formatter};
use std::sync::{Arc, RwLock};

use datafusion::catalog::CatalogProvider;
use datafusion::catalog::schema::SchemaProvider;
use datafusion::error::{DataFusionError, Result};
use datafusion::prelude::SessionContext;
use tokio::runtime::Handle;

use lakesoul_metadata::error::LakeSoulMetaDataError;
use lakesoul_metadata::MetaDataClientRef;
use proto::proto::entity::Namespace;
use std::any::Any;
use std::fmt::{Debug, Formatter};
use std::sync::{Arc, RwLock};
use tokio::runtime::Handle;

use crate::catalog::LakeSoulNamespace;

/// A metadata wrapper
/// may need a lock
Expand Down Expand Up @@ -105,6 +108,7 @@ impl CatalogProvider for LakeSoulCatalog {
domain: "public".into(),
};
let _ = futures::executor::block_on(async move {
// need a special runtime to finish sync jobs
Handle::current()
.spawn(async move { client.create_namespace(np).await })
.await
Expand Down
Loading
Loading