Skip to content

[misc] Remove unused classes across modules - #10815

Draft
chenjian2664 wants to merge 1 commit into
apache:masterfrom
chenjian2664:chenjian2664/bytequay/remove-unused-classes
Draft

chenjian2664 wants to merge 1 commit into
apache:masterfrom
chenjian2664:chenjian2664/bytequay/remove-unused-classes

Conversation

@chenjian2664

Copy link
Copy Markdown
Contributor

Purpose

Remove classes that no code in the repository uses anymore. Each module's removal is a separate commit, so it can be reviewed or reverted on its own.

Two kinds of classes are removed:

  • Classes that nothing references, not even tests, docs, Python code or SPI service files.
  • Classes that only their own tests used, because an earlier refactor removed their last production caller. Their tests are removed with them.

Removed per module:

  • common: CastedVector, SortContext, BinaryRowDataUtil, BooleanArrayList, ListDelimitedSerializer, MapBuilder, ReuseByteArrayOutputStream, SerializablePredicate, plus LocalFileUtils, LongTripleArrayList, ObjectUtils and ConstantGlobalIndexReader, whose last callers were removed earlier. GlobalIndexScanner now merges readers instead of padding shorter indexes, so the constant padding reader is no longer needed.
  • core: RowIdIndexFieldsExtractor, IntObjectSerializer.
  • format: AvroSchemaTypelessReader, JodaConverter and the Parquet position package. JodaConverter was the only user of the optional joda-time dependency, so that dependency is removed too.
  • cdc: CdcRecordPartitionKeyExtractor, and AliyunFieldParser, which AliyunRecordParser stopped using once it extracted types itself.
  • ci: ScalaSuffixChecker, which no CI script or build configuration runs. The Maven dependency:tree parsing that only it used is removed too: DependencyTree, the tree parsing in DependencyParser, and the scope and optional fields of Dependency.
  • flink: RowDataKeyAndBucketExtractor (unused since the sink moved to InternalRow), NumberSequenceRowSource (no longer built by aggregate push down), and the legacy SinkFunction shim in paimon-flink1-common (unused since the log system code was removed).
  • spark: the SQLHelper trait.

Some classes are unused here but intentionally kept: public or deprecated API, compatibility shims, the Arrow native read/write extension points, Vortex JNI bindings that mirror the upstream native library, Flink CDC pipeline utilities used by the Flink CDC project, and recently added building blocks that are not wired in yet.

Tests

  • Tests that only covered a removed class are removed with it.
  • GlobalIndexEvaluatorTest no longer tests padding shorter indexes with a constant reader, which production code no longer does. It still covers how the evaluator ANDs readers that cover different row ranges.
  • CdcRecordKeyAndBucketExtractorTest now compares the CDC extractor against FixedBucketRowKeyExtractor directly. That is the class the removed RowDataKeyAndBucketExtractor wrapped.
  • TestCdcEventParser falls back to an empty record list inline instead of calling ObjectUtils.

Remove classes in paimon-common that no production code references:
CastedVector, SortContext, BinaryRowDataUtil, BooleanArrayList,
ListDelimitedSerializer, MapBuilder, ReuseByteArrayOutputStream and
SerializablePredicate.

Also remove classes whose last production caller was removed by an
earlier refactor, together with the tests that only covered them:
LocalFileUtils, LongTripleArrayList, ObjectUtils and
ConstantGlobalIndexReader. GlobalIndexScanner now unions readers
instead of padding shorter indexes, so the padding test is dropped.
@chenjian2664
chenjian2664 force-pushed the chenjian2664/bytequay/remove-unused-classes branch from e5bc1f0 to 33464dd Compare October 26, 2026 13:46
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.

1 participant