Iceberg core code#1836
Conversation
Git Conflict Resolution Guide for Iceberg PRsOverviewThis guide provides general strategies and rules for resolving merge conflicts when integrating Iceberg-related changes, particularly during cherry-pick operations. It emphasizes systematic conflict resolution, dependency management, and thorough validation. Core Principles1. Understand Before Acting
2. Preserve User Intent
3. Validate Thoroughly
General Resolution StrategyStep 1: Analyze Conflicts# Check conflict status
git status
# View conflicting sections
git diff --ours <file> # Current branch (HEAD)
git diff --theirs <file> # Incoming changesDecision Matrix:
Step 2: Resolve by File TypeA. Implementation Files (Prefer Incoming)For core feature implementations: # Accept incoming changes
git checkout --theirs path/to/file.cpp
# DO NOT stage yet - let user review with git diff firstWhen to use:
When NOT to use:
B. Header Files (Manual Merge)Headers often need both versions: # Edit manually to combine declarations
vim path/to/file.h
# DO NOT stage yet - let user review with git diff firstMerge checklist:
C. Build Configuration (Manual Merge)
Pattern to follow: # Combine source files from both versions
add_executable(
target_name
FileFromHEAD.cpp # Keep existing
FileFromIncoming.cpp # Add new
SharedFile.cpp # Keep once
)
# Remove duplicate sections
# Keep only one VELOX_ENABLE_PARQUET block
# Consolidate target_link_libraries callsCommon issues:
Step 3: Fix Missing DependenciesAfter resolving conflicts, compilation often reveals missing dependencies: Missing Method DeclarationsSymptom: Solution:
Template for adding methods: // In header file (.h)
/// Brief description of what the method does.
/// @param param1 Description of parameter
/// @return Description of return value
ReturnType methodName(ParamType param1);
// In source file (.cpp)
ReturnType ClassName::methodName(ParamType param1) {
// Implementation
}Missing Helper FunctionsCommon missing helpers in Iceberg tests: // File size utility
static uint64_t getFileSize(const std::string& path);
// Split creation helpers
std::vector<std::shared_ptr<ConnectorSplit>> makeIcebergSplits(...);
std::shared_ptr<ConnectorSplit> makeIcebergSplitWithInfoColumns(...);
// Column handle creation
ColumnHandleMap makeColumnHandles(...);Step 4: Build and TestCritical Rule: Always build and test before completing cherry-pick. # Build affected targets
cd _build/release
make <target_name> -j8
# Run tests
./<path_to_test_binary>
# Verify all tests pass
# Expected: [ PASSED ] X testsIf tests fail:
Step 5: User Review (CRITICAL)Rule: Never automatically stage or commit resolved conflicts. Always let the user review changes first. # DO NOT run these automatically:
# git add <files>
# git cherry-pick --continue
# Instead, inform the user:
echo "✅ Conflicts resolved and tests pass!"
echo ""
echo "Please review the changes locally:"
echo " git diff # Review unstaged changes"
echo " git diff <specific-file> # Review specific file"
echo ""
echo "After review, stage and continue:"
echo " git add <files> # Stage resolved files"
echo " git status # Verify all conflicts resolved"
echo " git cherry-pick --continue # Complete the cherry-pick"Why this matters:
Step 6: Complete Cherry-Pick (User Action)After user review and staging: # Review unstaged changes first
git diff
# Stage resolved files after review
git add <resolved-files>
# Verify all conflicts are resolved
git status
# Review staged changes
git diff --cached
# If satisfied, continue
GIT_EDITOR=true git cherry-pick --continue
# Or with custom commit message
git cherry-pick --continueConflict Resolution RulesRule 1: Minimal Change Principle
Rule 2: Dependency Completeness
Rule 3: Test Coverage Preservation
Rule 4: Build Configuration Integrity
Rule 5: Documentation Synchronization
Common Conflict PatternsPattern 1: Test Base Class EvolutionConflict: Test base class has different helper methods in each version. Resolution:
Pattern 2: CMakeLists.txt Source File ListsConflict: Different test files in each version. Resolution: # Merge approach
add_executable(
test_target
# Files from HEAD
ExistingTest1.cpp
ExistingTest2.cpp
# Files from incoming
NewTest1.cpp
NewTest2.cpp
# Shared files (keep once)
TestBase.cpp
)Pattern 3: Header Include GuardsConflict: Different include structures. Resolution:
Pattern 4: Method Signature ChangesConflict: Same method with different signatures. Resolution:
Troubleshooting GuideIssue: Compilation Errors After ResolutionSymptoms:
Diagnosis: # Check what's missing
make <target> 2>&1 | grep "error:"
# Search for method definitions
git log -p --all -S "methodName"
# Check incoming commit for context
git show <commit_hash>Solutions:
Issue: Test Failures After ResolutionSymptoms:
Diagnosis: # Run tests with verbose output
./test_binary --gtest_filter="FailingTest.*" --gtest_verbose
# Check test expectations
git diff HEAD~1 <test_file>Solutions:
Issue: Linker WarningsSymptoms:
Diagnosis: # Check CMakeLists.txt for duplicates
grep -n "target_link_libraries" CMakeLists.txtSolutions:
Best Practices ChecklistBefore completing cherry-pick:
Example WorkflowHere's a complete example workflow: # 1. Start cherry-pick
git cherry-pick <commit-hash>
# 2. Conflicts detected
git status # Shows conflicting files
# 3. Resolve each file (DO NOT stage yet)
git checkout --theirs file1.cpp
# Manual merge for file2.h
vim file2.h
# 4. Build and test
cd _build/release
make target -j8
./path/to/test
# 5. If compilation fails, add missing dependencies
vim path/to/header.h # Add declarations
vim path/to/source.cpp # Add implementations
# 6. Rebuild and retest
make target -j8
./path/to/test
# 7. Inform user to review (DO NOT stage or commit)
echo "✅ Conflicts resolved and tests pass!"
echo ""
echo "Please review changes locally:"
echo " git diff # Review all unstaged changes"
echo " git diff file1.cpp # Review specific file"
echo ""
echo "After review, stage and continue:"
echo " git add <files> # Stage resolved files"
echo " git status # Verify all conflicts resolved"
echo " git cherry-pick --continue # Complete the cherry-pick"
# 8. User reviews and continues (manual step)
git diff # Review changes
git add file1.cpp file2.h # Stage after review
git status # Verify
git cherry-pick --continue # CompleteSummarySuccessful conflict resolution requires:
By following these rules and strategies, you can systematically resolve conflicts while maintaining code quality and preserving both upstream improvements and local customizations. Quick Reference
Remember: The goal is not just to resolve conflicts, but to create a working, tested, and maintainable codebase that combines the best of both versions. |
|
Invalid alchemy verb: rebase |
|
alchemy merge @2026-03-23T21:37:29Z |
|
alchemy link 4f10953 @2026-03-23T21:37:29Z |
|
Added new rebase item:
|
|
Failed to cherry-pick commit 4f10953 in rebase request #1841: Please:
|
4f10953 to
83bb267
Compare
|
alchemy link 83bb267 @2026-03-24T15:53:57Z |
|
The following unexpired item was removed at
Added new rebase item:
|
|
Failed to cherry-pick commit 83bb267 in rebase request #1850: Please:
|
83bb267 to
d8b1672
Compare
|
Failed to cherry-pick commit a3ff9cb in rebase request #2161: Please:
|
|
Failed to cherry-pick commit a3ff9cb in rebase request #2162: Please:
|
|
Failed to cherry-pick commit a3ff9cb in rebase request #2163: Please:
|
|
Failed to cherry-pick commit a3ff9cb in rebase request #2165: Please:
|
Co-authored-by: mohsaka <135669458+mohsaka@users.noreply.github.com> Co-authored-by: nmahadevuni <nmahadevuni@gmail.com>
|
alchemy merge @2026-06-19T11:32:13Z |
|
alchemy link 0a9da7d @2026-06-19T11:32:13Z |
|
The following unexpired item was removed at
Added new rebase item:
|
|
Failed to cherry-pick commit 0a9da7d in rebase request #2180: Please:
|
|
Failed to cherry-pick commit 0a9da7d in rebase request #2181: Please:
|
|
Failed to cherry-pick commit 0a9da7d in rebase request #2182: Please:
|
|
Failed to cherry-pick commit 0a9da7d in rebase request #2183: Please:
|
|
alchemy close @2026-06-25T00:33:43Z |
|
Closed rebase item in group |
|
alchemy close @2026-06-25T00:33:00Z |
|
Closed rebase item in group |
Fix the rebase issue in PR 425
Steps to resolve conflicts
Get the commit sha from output:
Rebase your branch with staging/staging-rebase and fix the conflict. If the rebase item is a PR, you can change the base branch to this staging branch.
Find the timestamp from conflict message like:
alchemy merge @2026-05-15T06:38:01Zalchemy link [updated comma-separated commit SHAs for this issue] @2026-05-15T06:38:01ZCopy the command like
alchemy merge @2026-05-15T06:38:01Zand paste it as a new comment in this PRThen follow the steps below to do the test.