Skip to content

feat(binder): implement AvroValueAdapter and RecordBinder for Avro to Iceberg conversion[WIP] #2744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Gezi-lzq
Copy link
Contributor

@Gezi-lzq Gezi-lzq commented Aug 6, 2025

@Gezi-lzq Gezi-lzq force-pushed the feat/iceberg-binder branch from 16aabe8 to 30abf31 Compare August 6, 2025 09:37
@Gezi-lzq Gezi-lzq requested a review from Copilot August 7, 2025 09:53
Copy link
Contributor

@Copilot 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 implements a new Avro to Iceberg conversion mechanism using the adapter pattern for improved performance and flexibility. The implementation includes lazy-evaluation Record views that convert field values only when accessed, avoiding upfront conversion overhead.

Key changes include:

  • Introduction of TypeAdapter interface and abstract implementation for type conversion
  • RecordBinder that creates lazy-evaluation Record views from Avro GenericRecords
  • AvroValueAdapter with Avro-specific type handling for Utf8, EnumSymbol, and Fixed types

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
TypeAdapter.java Interface for converting values between schema systems
AbstractTypeAdapter.java Base implementation with common type conversion logic
AvroValueAdapter.java Avro-specific type adapter implementation
RecordBinder.java Factory creating lazy-evaluation Record views
AvroRecordBinderTest.java Comprehensive test suite for all data type conversions
PerformanceComparisonTest.java Performance comparison between RecordBinder and Visitor
PerformanceProfilingTest.java Detailed profiling test for performance analysis

*/
public class PerformanceProfilingTest {

private static final int TEST_DURATION_MINUTES = 1;
Copy link
Preview

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

The comment on line 53 states the test runs for 5 minutes, but the constant is set to 1 minute. This creates a mismatch between documentation and implementation.

Suggested change
private static final int TEST_DURATION_MINUTES = 1;
private static final int TEST_DURATION_MINUTES = 5;

Copilot uses AI. Check for mistakes.

System.out.println("Warming up RecordBinder...");
performWarmup(recordBinder, null);

System.out.println("Starting 5-minute RecordBinder performance test...");
Copy link
Preview

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

The log message claims a 5-minute test duration, but TEST_DURATION_MINUTES is set to 1 minute. This inconsistency should be corrected.

Suggested change
System.out.println("Starting 5-minute RecordBinder performance test...");
System.out.printf("Starting %d-minute RecordBinder performance test...\n", TEST_DURATION_MINUTES);

Copilot uses AI. Check for mistakes.

System.out.println("Warming up Visitor...");
performWarmup(null, visitor);

System.out.println("Starting 5-minute Visitor performance test...");
Copy link
Preview

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

The log message claims a 5-minute test duration, but TEST_DURATION_MINUTES is set to 1 minute. This inconsistency should be corrected.

Suggested change
System.out.println("Starting 5-minute Visitor performance test...");
System.out.println("Starting " + TEST_DURATION_MINUTES + "-minute Visitor performance test...");

Copilot uses AI. Check for mistakes.

@Gezi-lzq Gezi-lzq changed the title feat(binder): implement AvroValueAdapter and RecordBinder for Avro to Iceberg conversion [WIP] feat(binder): implement AvroValueAdapter and RecordBinder for Avro to Iceberg conversion Aug 11, 2025
@Gezi-lzq Gezi-lzq changed the title [WIP] feat(binder): implement AvroValueAdapter and RecordBinder for Avro to Iceberg conversion feat(binder): implement AvroValueAdapter and RecordBinder for Avro to Iceberg conversion[WIP] Aug 11, 2025
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.

2 participants