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

feat!: allow ProjectionExec to take general inputs #384

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

iajoiner
Copy link
Contributor

Please be sure to look over the pull request guidelines here: https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/main/CONTRIBUTING.md#submit-pr.

Please go through the following checklist

Rationale for this change

We need to make it possible to compose ProjectionExec with ProofPlans.

What changes are included in this PR?

  • replace TableExpr in ProjectionExec with Box<DynProofPlan>

Are these changes tested?

Yes.

@iajoiner
Copy link
Contributor Author

Replacing #377 since GitHub was stuck

@iajoiner iajoiner force-pushed the feat/proj branch 2 times, most recently from cc62e5e to 668ace0 Compare November 21, 2024 04:48
@@ -71,15 +87,15 @@ impl ProofPlan for ProjectionExec {
}

fn get_column_references(&self) -> IndexSet<ColumnRef> {
let mut columns = IndexSet::default();
let mut columns = self.input.get_column_references();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let mut columns = self.input.get_column_references();
return self.input.get_column_references();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. Projection should result in all output column refs also being input ones.

Comment on lines 129 to 147
let t = "PLACEHOLDER_SCHEMA.PLACEHOLDER_TABLE".parse().unwrap();
let mut accessor = OwnedTableTestAccessor::<InnerProductProof>::new_empty_with_setup(());
accessor.add_table(t, data, 0);
let ast = projection(cols_expr_plan(t, &["b"], &accessor), tab(t));
let ast = projection(
cols_expr_plan(t, &["b"], &accessor),
table_exec(
t,
vec![
ColumnField::new("a".parse().unwrap(), ColumnType::BigInt),
ColumnField::new("b".parse().unwrap(), ColumnType::BigInt),
],
),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let t = "PLACEHOLDER_SCHEMA.PLACEHOLDER_TABLE".parse().unwrap();
let mut accessor = OwnedTableTestAccessor::<InnerProductProof>::new_empty_with_setup(());
accessor.add_table(t, data, 0);
let ast = projection(cols_expr_plan(t, &["b"], &accessor), tab(t));
let ast = projection(
cols_expr_plan(t, &["b"], &accessor),
table_exec(
t,
vec![
ColumnField::new("a".parse().unwrap(), ColumnType::BigInt),
ColumnField::new("b".parse().unwrap(), ColumnType::BigInt),
],
),
);
let t = "sxt.t".parse().unwrap();
let accessor = OwnedTableTestAccessor::<InnerProductProof>::new_from_table(t, data, 0, ());
let ast = projection(
vec![AliasedDynProofExpr {
expr: DynProofExpr::Column(ColumnExpr::new(ColumnRef::new(
"PLACEHOLDER_SCHEMA.PLACEHOLDER_TABLE".parse().unwrap(),
"b".parse().unwrap(),
ColumnType::BigInt,
))),
alias: "b".parse().unwrap(),
}],
table_exec(
t,
vec![
ColumnField::new("a".parse().unwrap(), ColumnType::BigInt),
ColumnField::new("b".parse().unwrap(), ColumnType::BigInt),
],
),
);

@iajoiner iajoiner enabled auto-merge November 27, 2024 20:54
@iajoiner iajoiner mentioned this pull request Dec 3, 2024
2 tasks
@JayWhite2357 JayWhite2357 removed their request for review December 9, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants