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

Enable external metastores #483

Merged
merged 8 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
- name: Install protoc
run: sudo apt install -y protobuf-compiler

# Use https://github.com/marketplace/actions/rust-cache

Expand Down
38 changes: 38 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
members = ["clade"]

[package]
name = "seafowl"
Expand Down Expand Up @@ -44,6 +45,7 @@ base64 = "0.21.0"

bytes = "1.4.0"
chrono = { version = "0.4", default_features = false }
clade = { path = "clade" }
clap = { version = "3.2.19", features = [ "derive" ] }
config = "0.13.3"

Expand Down Expand Up @@ -90,6 +92,7 @@ sqlx = { version = "0.7.1", features = [ "runtime-tokio-rustls", "sqlite", "any"
strum = ">=0.24"
strum_macros = ">=0.24"
tempfile = "3"
thiserror = "1"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "signal", "process"] }
tonic = { version = "0.10.0", optional = true }
url = "2.2"
Expand All @@ -106,6 +109,7 @@ assert_cmd = "2"
assert_unordered = "0.3"
rstest = "*"
serial_test = "2"
tonic-reflection = "0.10"
wiremock = "0.5"

[build-dependencies]
Expand Down
11 changes: 11 additions & 0 deletions clade/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "clade"
Copy link
Contributor

Choose a reason for hiding this comment

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

Might as well keep calling it clade, though we might need to get more people involved in naming it if we ever want to spin it out into a separate open source project. (alternative name: simply seafowl-metastore)

version = "0.1.0"
edition = "2021"

[dependencies]
prost = "0.12"
tonic = "0.10"

[build-dependencies]
tonic-build = "0.10"
13 changes: 13 additions & 0 deletions clade/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use std::env;
use std::path::PathBuf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
tonic_build::configure()
.file_descriptor_set_path(out_dir.join("clade_descriptor.bin"))
.build_server(true)
.build_client(true)
.compile(&["proto/schema.proto"], &["proto"])?;

Ok(())
}
26 changes: 26 additions & 0 deletions clade/proto/schema.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";

package clade.schema;

message SchemaObject {
string name = 1;
repeated TableObject tables = 2;
}

message TableObject {
string name = 1;
string location = 2;
}

message ListSchemaRequest {
string catalog_name = 1;
}

message ListSchemaResponse {
repeated SchemaObject schemas = 1;
}

service SchemaStoreService {
// List the available schemas
rpc ListSchemas(ListSchemaRequest) returns (ListSchemaResponse);
}
5 changes: 5 additions & 0 deletions clade/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pub mod schema {
tonic::include_proto!("clade.schema");
pub const FILE_DESCRIPTOR_SET: &[u8] =
tonic::include_file_descriptor_set!("clade_descriptor");
}
Loading