From 383320c13db4676f2d52bb399e65dd33e9c4264f Mon Sep 17 00:00:00 2001 From: Ian Joiner <14581281+iajoiner@users.noreply.github.com> Date: Wed, 4 Dec 2024 08:37:02 -0500 Subject: [PATCH] fix: address NITs --- crates/proof-of-sql/src/base/proof/error.rs | 6 +++--- crates/proof-of-sql/src/sql/proof_plans/filter_exec.rs | 2 +- crates/proof-of-sql/src/sql/proof_plans/mod.rs | 2 +- crates/proof-of-sql/src/sql/proof_plans/slice_exec.rs | 4 ++-- crates/proof-of-sql/src/sql/proof_plans/slice_exec_test.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/proof-of-sql/src/base/proof/error.rs b/crates/proof-of-sql/src/base/proof/error.rs index d918f4e77..489b0144b 100644 --- a/crates/proof-of-sql/src/base/proof/error.rs +++ b/crates/proof-of-sql/src/base/proof/error.rs @@ -6,7 +6,7 @@ pub enum ProofError { #[snafu(display("Verification error: {error}"))] /// This error occurs when a proof failed to verify. VerificationError { error: &'static str }, - /// Unsupported error - #[snafu(display("Unsupported error: {error}"))] - UnsupportedError { error: &'static str }, + /// This error occurs when a query plan is not supported. + #[snafu(display("Unsupported query plan: {error}"))] + UnsupportedQueryPlan { error: &'static str }, } diff --git a/crates/proof-of-sql/src/sql/proof_plans/filter_exec.rs b/crates/proof-of-sql/src/sql/proof_plans/filter_exec.rs index 37b74a0f2..d4fb992f8 100644 --- a/crates/proof-of-sql/src/sql/proof_plans/filter_exec.rs +++ b/crates/proof-of-sql/src/sql/proof_plans/filter_exec.rs @@ -286,7 +286,7 @@ pub(super) fn verify_filter( } #[allow(clippy::too_many_arguments, clippy::many_single_char_names)] -pub(crate) fn prove_filter<'a, S: Scalar + 'a>( +pub(super) fn prove_filter<'a, S: Scalar + 'a>( builder: &mut FinalRoundBuilder<'a, S>, alloc: &'a Bump, alpha: S, diff --git a/crates/proof-of-sql/src/sql/proof_plans/mod.rs b/crates/proof-of-sql/src/sql/proof_plans/mod.rs index be0202f49..71097cb28 100644 --- a/crates/proof-of-sql/src/sql/proof_plans/mod.rs +++ b/crates/proof-of-sql/src/sql/proof_plans/mod.rs @@ -16,7 +16,7 @@ mod projection_exec_test; pub(crate) mod test_utility; mod filter_exec; -pub(super) use filter_exec::FilterExec; +pub(crate) use filter_exec::FilterExec; #[cfg(test)] pub(crate) use filter_exec::OstensibleFilterExec; #[cfg(all(test, feature = "blitzar"))] diff --git a/crates/proof-of-sql/src/sql/proof_plans/slice_exec.rs b/crates/proof-of-sql/src/sql/proof_plans/slice_exec.rs index 8ec6a255c..b06e3b956 100644 --- a/crates/proof-of-sql/src/sql/proof_plans/slice_exec.rs +++ b/crates/proof-of-sql/src/sql/proof_plans/slice_exec.rs @@ -75,8 +75,8 @@ where ) -> Result, ProofError> { // 1. columns // We do not support `GroupByExec` as input for now - if let DynProofPlan::GroupBy(_) = *self.input { - return Err(ProofError::UnsupportedError { + if matches!(*self.input, DynProofPlan::GroupBy(_)) { + return Err(ProofError::UnsupportedQueryPlan { error: "GroupByExec as input for another plan is not supported", }); } diff --git a/crates/proof-of-sql/src/sql/proof_plans/slice_exec_test.rs b/crates/proof-of-sql/src/sql/proof_plans/slice_exec_test.rs index a1080ce55..bd237f4f4 100644 --- a/crates/proof-of-sql/src/sql/proof_plans/slice_exec_test.rs +++ b/crates/proof-of-sql/src/sql/proof_plans/slice_exec_test.rs @@ -540,7 +540,7 @@ fn we_cannot_prove_a_slice_exec_if_it_has_groupby_as_input_for_now() { assert!(matches!( res.verify(&expr, &accessor, &()), Err(QueryError::ProofError { - source: ProofError::UnsupportedError { .. } + source: ProofError::UnsupportedQueryPlan { .. } }) )); }