Skip to content

Conversation

@gz
Copy link
Contributor

@gz gz commented Dec 21, 2025

Also add IsNone trait for future null optimization.
Remove some unused/old example benchmark code.

@gz gz requested review from Copilot, mihaibudiu and ryzhyk December 21, 2025 23:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces procedural macros for tuple generation and adds an IsNone trait for future null optimization. It replaces the macro-based tuple declaration system with a procedural macro approach and removes unused example/benchmark code.

  • Adds feldera-macros crate with declare_tuple! macro and IsNone derive macro
  • Migrates tuple generation from declarative macros to procedural macros
  • Removes unused GDELT benchmarks and JSON example code

Reviewed changes

Copilot reviewed 55 out of 59 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
crates/feldera-macros/* New crate providing procedural macros for tuple generation and IsNone trait
crates/dbsp/src/utils/tuple/gen.rs Removed old declarative macro implementation
crates/dbsp/src/utils/tuple.rs Updated to use new procedural macros
crates/dbsp/src/utils/is_none.rs New trait and implementations for null optimization
crates/dbsp/src/trace.rs Added IsNone bound to DBData trait
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/backend/rust/*.java Updated Java code generators to use new macro syntax
crates/dbsp/examples/json.rs Removed unused JSON example
crates/dbsp/benches/gdelt/* Removed unused GDELT benchmarks
Various test and example files Added IsNone derive to struct definitions

@gz gz force-pushed the none-optimziation-part1 branch 3 times, most recently from d3a4243 to d2301f9 Compare December 22, 2025 00:48
@gz gz force-pushed the none-optimziation-part1 branch from d2301f9 to e017654 Compare December 22, 2025 01:24
@gz gz force-pushed the none-optimziation-part1 branch from e017654 to 11e82fa Compare December 22, 2025 02:41
@gz gz force-pushed the none-optimziation-part1 branch from 11e82fa to b4751f6 Compare December 22, 2025 04:28
@gz gz force-pushed the none-optimziation-part1 branch from b4751f6 to 7d1bc0a Compare December 22, 2025 07:28
@gz gz force-pushed the none-optimziation-part1 branch from 7d1bc0a to 5744281 Compare December 22, 2025 17:11
@gz gz force-pushed the none-optimziation-part1 branch 2 times, most recently from ca7a6b7 to 3e3c091 Compare December 22, 2025 18:12
@mihaibudiu
Copy link
Contributor

Let me know when this is ready for review, I still see a lot of churn

@gz
Copy link
Contributor Author

gz commented Dec 22, 2025

it is ready

@gz gz force-pushed the none-optimziation-part1 branch 2 times, most recently from 618b224 to aad3b1f Compare December 22, 2025 19:18
serde_json = { workspace = true }
ptr_meta = { workspace = true }
feldera-types = { workspace = true }
feldera-macros = { workspace = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove examples and benchmarks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed gdelt because no one has touched it in years
removed ijson because we never ended up using it

Copy link
Contributor

Choose a reason for hiding this comment

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

The fact no one has touched it may be a sign that it needs to be kept; check with Leonid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ryzhyk can comment

Copy link
Contributor

Choose a reason for hiding this comment

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

It's ok for it to go

if std::env::var_os("FELDERA_DEV_MACROS_DUMP").is_some() {
let parsed_file: syn::File = syn::parse2(expanded.clone()).expect("Failed to parse output");
let formatted = prettyplease::unparse(&parsed_file);
eprintln!("{}", formatted);
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?

expanded
}

pub(super) struct TupleDef {
Copy link
Contributor

Choose a reason for hiding this comment

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

putting this first would make the code easier to review

.into_iter()
.filter_map(|param| {
if let syn::GenericParam::Type(ty) = param {
Some(ty.ident)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why Some(...) has a type of Punctuated<>.

Also add IsNone trait for future null optimization.

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
@gz gz force-pushed the none-optimziation-part1 branch from aad3b1f to 37130ab Compare December 22, 2025 20:07
Copy link
Contributor

@ryzhyk ryzhyk left a comment

Choose a reason for hiding this comment

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

I don't yet know how to read procedural macros, so didn't review that part. I wonder if IsNone is sufficient for the upcoming rkyv optimization. Don't we also need to IsOption to determine if the type is an option and needs a bit in the bitmap?

serde_json = { workspace = true }
ptr_meta = { workspace = true }
feldera-types = { workspace = true }
feldera-macros = { workspace = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

It's ok for it to go

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.

4 participants