Thank you for your interest in contributing to the Databricks C++ SDK! This document provides guidelines and instructions for contributing.
- Report Bugs: Found a bug? Open an issue with details to reproduce it
- Suggest Features: Have an idea? Open an issue to discuss it
- Improve Documentation: Fix typos, clarify instructions, add examples
- Write Code: Fix bugs, implement features, add tests
- Review Pull Requests: Help review and test others' contributions
- C++17 compatible compiler (GCC 7+, Clang 5+)
- CMake 3.14 or higher
- ODBC Driver Manager (unixODBC on Linux/macOS)
- Simba Spark ODBC Driver
-
Fork and Clone
git clone https://github.com/YOUR_USERNAME/databricks-sdk-cpp.git cd databricks-sdk-cpp -
Build the Project
make build-all
-
Run Tests
make test -
Verify ODBC Setup
./scripts/check_odbc_setup.sh
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-number-descriptionBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions or changes
Follow the coding standards below and make sure to:
- Write clear, self-documenting code
- Add comments for complex logic
- Update documentation if needed
- Add tests for new functionality
# Run all tests
make test
# Build examples to verify they still compile
make build-examples
# Run specific test
cd build && ./tests/unit_tests --gtest_filter=ClientTest.*Write clear commit messages following this format:
<type>: <subject>
<body>
<footer>
Types:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Test changeschore:Build process or auxiliary tool changes
Example:
feat: add support for Unity Catalog volumes API
Implement VolumeClient class with list, create, and delete operations.
Includes full error handling and retry logic.
Closes #123
git push origin feature/your-feature-nameThen create a pull request on GitHub with:
- Clear description of changes
- Link to related issues
- Screenshots/examples if UI or behavior changes
- Checklist completion (see PR template)
We use .clang-format to enforce consistent style:
make formatKey conventions:
- Indentation: 4 spaces (no tabs)
- Line length: 120 characters maximum
- Naming:
snake_casefor variables, functions, and file namesPascalCasefor classes and structsSCREAMING_SNAKE_CASEfor constants
- Braces: K&R style (opening brace on same line)
- Pointers/References:
Type* ptrandType& ref(left alignment)
Example:
namespace databricks {
class MyClass {
public:
MyClass(const std::string& name);
bool process_data(const std::vector<int>& data);
private:
std::string name_;
int count_ = 0;
};
} // namespace databricksUse #pragma once for all new headers:
// Copyright (c) 2025 Calvin Min
// SPDX-License-Identifier: MIT
#pragma once
namespace databricks {
// ... your code
}Use Doxygen comments for all public APIs:
/**
* @brief Brief description of the function
*
* Detailed description with usage examples if needed.
*
* @param param1 Description of first parameter
* @param param2 Description of second parameter
* @return Description of return value
* @throws std::runtime_error if something goes wrong
*
* @code
* auto client = Client::Builder().build();
* auto result = client.query("SELECT * FROM table");
* @endcode
*/
std::vector<std::string> query(const std::string& sql, int limit);- Use Google Test framework (already integrated)
- Place tests in
tests/unit/directory - Name test files:
test_<component>.cpp - Use descriptive test names:
TEST(ComponentTest, MethodNameWithScenario)
Example:
#include <gtest/gtest.h>
#include <databricks/core/client.h>
TEST(ClientTest, QueryWithValidParameters) {
// Arrange
databricks::AuthConfig auth;
auth.host = "https://test.databricks.com";
auth.set_token("test_token");
databricks::SQLConfig sql;
sql.http_path = "/sql/1.0/warehouses/test";
auto client = databricks::Client::Builder()
.with_auth(auth)
.with_sql(sql)
.build();
// Act & Assert
EXPECT_EQ(client.get_auth_config().host, "https://test.databricks.com");
}- Aim for >80% code coverage for new features
- Test both success and failure paths
- Test edge cases and boundary conditions
- Use mocks for external dependencies (see
tests/mocks/)
- Functionality: Does it work as intended?
- Tests: Are there adequate tests?
- Documentation: Is it well documented?
- Style: Does it follow project conventions?
- Performance: Any performance implications?
- Security: Any security concerns?
- Compatibility: Works on Linux/macOS?
- Be open to feedback - it makes the code better!
- Respond to all comments (even if just to acknowledge)
- Make requested changes or explain why not
- Mark conversations as resolved once addressed
- Update your PR based on feedback
When creating issues, use appropriate labels:
bug- Something isn't workingfeature- New feature requestdocumentation- Documentation improvementsgood first issue- Good for newcomershelp wanted- Community help neededquestion- Further information requestedenhancement- Improvement to existing featureperformance- Performance relatedsecurity- Security related
New to the project? Look for issues labeled good first issue:
Example Good First Issues:
- Add missing documentation
- Fix typos or formatting
- Add example code
- Write additional tests
- Small bug fixes
- README.md - Project overview and usage
- API Documentation - Generated API docs
- Tests README - Testing guide
- Questions: Open a GitHub Discussion or Issue with
questionlabel - Bugs: Open an issue with reproduction steps
- Security: For security concerns, please open a private security advisory on GitHub (don't open public issues)
Contributors are recognized in:
- GitHub contributors page
- Release notes
- Project documentation
Thank you for contributing to make this project better! 🎉
By contributing, you agree that your contributions will be licensed under the MIT License.