Skip to content

Commit

Permalink
feat: initial metadata query support (#66)
Browse files Browse the repository at this point in the history
* feat: initial metadata request

* chore: clippy

* chore: fmt
  • Loading branch information
roeap authored Nov 29, 2024
1 parent a1aaae3 commit b0efff1
Show file tree
Hide file tree
Showing 21 changed files with 7,652 additions and 2,163 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install minimal stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
profile: default
toolchain: "stable"
override: true

- uses: Swatinem/rust-cache@v2
toolchain: stable

- name: Run integration tests
run: cargo test --tests
4 changes: 2 additions & 2 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ plugins:
# opt:
# - openapi_naming_strategy=simple
# - allow_merge=true
# - remote: buf.build/community/google-gnostic-openapi:v0.7.0
# out: gnostic
- remote: buf.build/community/google-gnostic-openapi:v0.7.0
out: openapi
1,915 changes: 1,268 additions & 647 deletions delta-sharing/client/src/gen/delta_sharing.v1.rs

Large diffs are not rendered by default.

2,327 changes: 1,916 additions & 411 deletions delta-sharing/client/src/gen/delta_sharing.v1.serde.rs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions delta-sharing/client/src/gen/delta_sharing.v1.tonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,5 +271,33 @@ pub mod delta_sharing_service_client {
);
self.inner.unary(req, path, codec).await
}
///
pub async fn get_table_metadata(
&mut self,
request: impl tonic::IntoRequest<super::GetTableMetadataRequest>,
) -> std::result::Result<tonic::Response<super::QueryResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/delta_sharing.v1.DeltaSharingService/GetTableMetadata",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"delta_sharing.v1.DeltaSharingService",
"GetTableMetadata",
),
);
self.inner.unary(req, path, codec).await
}
}
}
8 changes: 8 additions & 0 deletions delta-sharing/common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ pub enum Error {
#[error("Failed to extract recipient from request")]
MissingRecipient,

#[error(transparent)]
SerDe(#[from] serde_json::Error),

#[cfg(feature = "axum")]
#[error("Axum path: {0}")]
AxumPath(#[from] PathRejection),
Expand All @@ -55,6 +58,7 @@ impl From<Error> for Status {
"The request is unauthenticated. The bearer token is missing or incorrect.",
),
Error::Kernel(error) => Status::internal(error.to_string()),
Error::SerDe(_) => Status::internal("Encountered invalid table log."),
Error::InvalidTableLocation(location) => {
Status::internal(format!("Invalid table location: {}", location))
}
Expand Down Expand Up @@ -124,6 +128,10 @@ mod server {
error!("{}", message);
INTERNAL_ERROR
}
Error::SerDe(_) => {
error!("Inavalid table log encountered");
INTERNAL_ERROR
}
Error::Generic(message) => {
error!("Generic error: {}", message);
INTERNAL_ERROR
Expand Down
1,915 changes: 1,268 additions & 647 deletions delta-sharing/common/src/gen/delta_sharing.v1.rs

Large diffs are not rendered by default.

Loading

0 comments on commit b0efff1

Please sign in to comment.