voonhous commented on code in PR #19253:
URL: https://github.com/apache/hudi/pull/19253#discussion_r3881750693
##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/utils/TestCommonClientUtils.java:
##########
@@ -110,6 +116,47 @@ private static Stream<Arguments>
provideWriteVersionNativeLogExpectations() {
);
}
+ /**
+ * Every base file format must map to a log block type: a case missing from
the
+ * {@code getLogBlockType} switch only surfaces as a {@code HoodieException}
on the first MOR
+ * log write, which is what happened for VORTEX (apache/hudi#19252). Sweeps
the enum (never a
+ * hardcoded list); HOODIE_LOG is the log format itself and can never be a
base file format.
+ */
+ // TODO: drop the VORTEX exclusion once apache/hudi#19252 adds the case (see
testGetLogBlockTypeForVortex).
+ @ParameterizedTest
+ @EnumSource(value = HoodieFileFormat.class, mode = EnumSource.Mode.EXCLUDE,
names = {"HOODIE_LOG", "VORTEX"})
+ void testGetLogBlockTypeMapsEveryBaseFileFormat(HoodieFileFormat format) {
+ assertNotNull(
+
CommonClientUtils.getLogBlockType(writeConfigWithoutExplicitLogFormat(),
tableConfigWithBaseFormat(format)),
+ () -> "getLogBlockType must return a log block type for base file
format " + format
+ + "; add the missing case to the switch in
CommonClientUtils#getLogBlockType");
+ }
+
+ /**
+ * Same check as {@link #testGetLogBlockTypeMapsEveryBaseFileFormat} for
VORTEX, asserting
+ * the mapping apache/hudi#19252 adds (VORTEX -> AVRO_DATA_BLOCK).
+ */
+ @Disabled("Depends on apache/hudi#19252: on current master getLogBlockType
has no VORTEX case and throws "
Review Comment:
Dropped in 37c870633a17, and the exclusion now reads `TODO(#19252)`.
##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/utils/TestCommonClientUtils.java:
##########
@@ -110,6 +116,47 @@ private static Stream<Arguments>
provideWriteVersionNativeLogExpectations() {
);
}
+ /**
+ * Every base file format must map to a log block type: a case missing from
the
+ * {@code getLogBlockType} switch only surfaces as a {@code HoodieException}
on the first MOR
+ * log write, which is what happened for VORTEX (apache/hudi#19252). Sweeps
the enum (never a
Review Comment:
Reworded in 37c870633a17 to the inline log write path (write version below
TEN).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]