Skip to content

Conversation

@platinumhamburg
Copy link
Contributor

This commit introduces a new fluss-codegen module that provides runtime code generation capabilities using Janino compiler.

Core framework:

  • CodeGeneratorContext: Manages reusable code fragments and member variables
  • JavaCodeBuilder: Type-safe builder for constructing Java source code with support for modifiers, parameters, and various code constructs
  • CompileUtils: Compiles generated source code using Janino with caching
  • GeneratedClass: Wrapper for generated class with source and compiled class
  • CodeGenException: Exception for code generation failures

Code generators:

  • EqualiserCodeGenerator: Generates RecordEqualiser implementations for comparing InternalRow instances, supporting all Fluss data types

Key features:

  • Type-safe API with Modifier enum, PrimitiveType enum, and Param class
  • Comprehensive support for all Fluss data types including nested types
  • Field projection support for partial row comparison
  • Compiled class caching for performance
  • Janino dependency shaded to avoid classpath conflicts

Testing:

  • Comprehensive unit tests for all components
  • Generated code snapshot tests for reviewer understanding
  • 297 test cases covering edge cases and error handling

License:

  • Janino (BSD 3-Clause) license included in META-INF/licenses/

Purpose

Linked issue: close #2398 2398

Brief change log

Tests

API and Format

Documentation

@platinumhamburg platinumhamburg force-pushed the codegen branch 5 times, most recently from 39268fc to 0ec0b0f Compare January 19, 2026 07:09
This commit introduces a new fluss-codegen module that provides runtime
code generation capabilities using Janino compiler.

Core framework:
- CodeGeneratorContext: Manages reusable code fragments and member variables
- JavaCodeBuilder: Type-safe builder for constructing Java source code
  with support for modifiers, parameters, and various code constructs
- CompileUtils: Compiles generated source code using Janino with caching
- GeneratedClass: Wrapper for generated class with source and compiled class
- CodeGenException: Exception for code generation failures

Code generators:
- EqualiserCodeGenerator: Generates RecordEqualiser implementations for
  comparing InternalRow instances, supporting all Fluss data types

Key features:
- Type-safe API with Modifier enum, PrimitiveType enum, and Param class
- Comprehensive support for all Fluss data types including nested types
- Field projection support for partial row comparison
- Compiled class caching for performance
- Janino dependency shaded to avoid classpath conflicts

Testing:
- Comprehensive unit tests for all components
- Generated code snapshot tests for reviewer understanding
- 297 test cases covering edge cases and error handling

License:
- Janino (BSD 3-Clause) license included in META-INF/licenses/
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.

[codegen] Add fluss-codegen module for runtime code generation

1 participant