Skip to content

Migrate source package in Flink - #10632

Merged
nastra merged 2 commits into
apache:mainfrom
tomtongue:mig-junit5-flink-source
Jul 5, 2024
Merged

nastra merged 2 commits into
apache:mainfrom
tomtongue:mig-junit5-flink-source

Conversation

@tomtongue

@tomtongue tomtongue commented Jul 5, 2024 •

Copy link
Copy Markdown
Contributor

Migrate the following classes in iceberg-flink to JUnit 5 for #9087

Curretly only including Flink 1.19.

  • assigner
    • SplitAssignerTestBase
    • TestDefaultSplitAssigner
    • TestFileSequenceNumberBasedSplitAssigner
    • TestWatermarkBasedSplitAssigner
  • enumerator
    • TestContinuousIcebergEnumerator
    • TestContinuousSplitPlannerImpl
    • TestContinuousSplitPlannerImplStartStrategy
    • TestEnumerationHistory
    • TestIcebergEnumeratorStateSerializer
  • reader
    • ReaderFunctionTestBase
    • ReaderUtil
    • TestArrayBatchRecords
    • TestArrayPoolDataIteratorBatcherRowData
    • TestIcebergSourceReader
    • TestRowDataReaderFunction
  • split
    • TestIcebergSourceSplitSerializer
  • SplitHelpers

@github-actions github-actions Bot added the flink label Jul 5, 2024
@tomtongue

tomtongue commented Jul 5, 2024 •

Copy link
Copy Markdown
Contributor Author

This PR currently only has Flink 1.19 because the number of class changes is a bit many. Will create a backport PR for other Flink versions 1.17 and 1.18

@tomtongue

tomtongue commented Jul 5, 2024 •

Copy link
Copy Markdown
Contributor Author

@nastra when you have a chance, could you review this PR? Currently this PR only includes Flink 1.19 because of the a lot of file changes.

@@ -107,7 +114,11 @@ public void testSingleFileLessThanOneFullBatch() throws Exception {
public void testSingleFileWithMultipleBatches() throws Exception {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I set some comments to as(...) and remove some explicit comments to avoid exceeding 150 lines per a method limitation which is defined in the checkStyle.


@Rule public TestName testName = new TestName();
@RegisterExtension
private static final HadoopTableExtension tableResource =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

given that it's a static final it should be all uppercase

@tomtongue tomtongue Jul 5, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, thanks for the advice. Will update the variables.

@TempDir protected Path temporaryFolder;

@RegisterExtension
private static final HadoopTableExtension tableResource =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as in the other class

@nastra nastra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for working on this @tomtongue. I've just left two small comments

Assert.assertNull(batch11.nextRecordFromSplit());
Assert.assertNull(batch11.nextSplit());
assertThat(batch11.nextRecordFromSplit()).isNull();
assertThat(batch11.nextSplit());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isNull seems missing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, sorry thanks for the review! @ebyhr

break;
default:
Assert.fail("Unknown status: " + expectedStatus);
fail(String.format("Unknown status: %s", expectedStatus));

@ebyhr ebyhr Jul 5, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank for checking this. Fix in the new commit.

@tomtongue

Copy link
Copy Markdown
Contributor Author

Thanks for the review @nastra and @ebyhr. Could you review the new changes again? @nastra (if possible, @ebyhr)

@nastra nastra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @tomtongue and also thanks to @ebyhr for the additional review

@nastra
nastra merged commit ce1279e into apache:main Jul 5, 2024
@tomtongue
tomtongue deleted the mig-junit5-flink-source branch July 5, 2024 10:38
jasonf20 pushed a commit to jasonf20/iceberg that referenced this pull request Aug 4, 2024
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants