Thank you for your interest in contributing to Query Engine! This document provides guidelines and instructions for contributing.
- Rust 1.70+ - Install from rustup.rs
- Git - For version control
# Clone the repository
git clone https://github.com/AarambhDevHub/query-engine.git
cd query-engine
# Build the project
cargo build
# Run tests
cargo test
# Run the CLI
cargo run -p query-cliquery-engine/
├── crates/
│ ├── query-core/ # Core types, errors, schema definitions
│ ├── query-parser/ # SQL lexer and parser
│ ├── query-planner/ # Logical plan creation and optimization
│ ├── query-executor/ # Physical execution engine
│ ├── query-storage/ # Data source implementations (CSV, Parquet)
│ ├── query-index/ # B-Tree and Hash index implementations
│ ├── query-distributed/ # Distributed execution framework
│ └── query-cli/ # Command-line interface
├── examples-package/ # Example usage code
├── docs/ # Documentation
└── Cargo.toml # Workspace configuration
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description- Write clean, idiomatic Rust code
- Follow existing code patterns
- Add tests for new functionality
- Update documentation as needed
# Format code
cargo fmt
# Run clippy lints
cargo clippy
# Run all tests
cargo test --workspace
# Check specific crate
cargo check -p query-parserUse conventional commit messages:
feat: Add new SQL function SUBSTRING
fix: Handle NULL values in JOIN operations
docs: Update README with new examples
refactor: Simplify expression evaluation logic
test: Add tests for window functions
- Push your branch:
git push origin feature/your-feature-name - Open a Pull Request on GitHub
- Fill in the PR template with details
- Wait for review
# All tests
cargo test --workspace
# Specific crate
cargo test -p query-executor
# With output
cargo test -- --nocapture
# Single test
cargo test test_join_queries#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_function_name() {
// Arrange
let input = create_test_data();
// Act
let result = function_under_test(input);
// Assert
assert_eq!(result, expected);
}
}- Add doc comments (
///) to all public items - Update README.md for user-facing changes
- Add examples in the
examples-package/directory
/// Executes a SQL query and returns the results.
///
/// # Arguments
///
/// * `sql` - The SQL query string to execute
///
/// # Returns
///
/// A `Result` containing a vector of `RecordBatch` on success
///
/// # Example
///
/// ```ignore
/// let results = executor.execute("SELECT * FROM users")?;
/// ```
pub fn execute(&self, sql: &str) -> Result<Vec<RecordBatch>> {
// ...
}- Parser (
query-parser): Add lexer tokens and parser grammar - AST (
query-parser): Define AST nodes for the feature - Planner (
query-planner): Create logical plan nodes - Executor (
query-executor): Implement physical execution - Tests: Add unit and integration tests
- Examples: Create usage examples
- Docs: Update documentation
- Implement the
DataSourcetrait inquery-storage - Add file loading logic
- Register with the CLI
- Add tests and examples
When reporting bugs, please include:
- Rust version (
rustc --version) - Operating system
- Steps to reproduce
- Expected vs actual behavior
- Error messages (full stack trace if available)
For feature requests:
- Check existing issues for duplicates
- Describe the use case
- Propose a solution if possible
- Be open to discussion
All submissions require review. We use GitHub pull requests for this purpose:
- Maintainers will review your PR
- Address any feedback
- Once approved, your PR will be merged
- SQL Features: New SQL functions, operators, clauses
- Performance: Optimization, benchmarking
- Documentation: Tutorials, examples, API docs
- Testing: Increased coverage, edge cases
- Bug Fixes: Help squash bugs!
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
Thank you for contributing! 🙏