Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


danny0405 merged PR #19903:
URL: https://github.com/apache/hudi/pull/19903


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5692762399

   
   ## CI report:
   
   * 38e1243b80fde02f870c742ba44c36e29fc67f07 Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17153)
 
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5692057568

   
   ## CI report:
   
   * 979947bd991a652fa3ec1ea1e30324bebc7f3fd0 Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17114)
 
   * 38e1243b80fde02f870c742ba44c36e29fc67f07 Azure: 
[PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17153)
 
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5691870388

   
   ## CI report:
   
   * 979947bd991a652fa3ec1ea1e30324bebc7f3fd0 Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17114)
 
   * 38e1243b80fde02f870c742ba44c36e29fc67f07 UNKNOWN
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


cshuo commented on code in PR #19903:
URL: https://github.com/apache/hudi/pull/19903#discussion_r4022363795


##
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/source/reader/function/TestCdcVectorRead.java:
##
@@ -0,0 +1,382 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.source.reader.function;
+
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.model.FileSlice;
+import org.apache.hudi.common.model.HoodieBaseFile;
+import org.apache.hudi.common.model.HoodieFileFormat;
+import org.apache.hudi.common.model.HoodieTableType;
+import org.apache.hudi.common.schema.HoodieSchema;
+import org.apache.hudi.common.schema.HoodieSchemaUtils;
+import org.apache.hudi.common.table.HoodieTableConfig;
+import org.apache.hudi.common.table.HoodieTableMetaClient;
+import org.apache.hudi.common.table.HoodieTableVersion;
+import org.apache.hudi.common.table.cdc.HoodieCDCFileSplit;
+import org.apache.hudi.common.table.cdc.HoodieCDCInferenceCase;
+import org.apache.hudi.common.table.cdc.HoodieCDCSupplementalLoggingMode;
+import org.apache.hudi.common.table.cdc.HoodieCDCUtils;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.configuration.FlinkOptions;
+import org.apache.hudi.io.storage.row.HoodieRowDataFileWriter;
+import org.apache.hudi.io.storage.row.HoodieRowDataFileWriterFactory;
+import org.apache.hudi.source.reader.BatchRecords;
+import org.apache.hudi.source.split.HoodieCdcSourceSplit;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.format.InternalSchemaManager;
+import org.apache.hudi.table.format.cdc.CdcInputFormat;
+import org.apache.hudi.table.format.cdc.CdcInputSplit;
+import org.apache.hudi.table.format.mor.MergeOnReadTableState;
+import org.apache.hudi.util.DataTypeUtils;
+import org.apache.hudi.util.FlinkWriteClients;
+import org.apache.hudi.util.HoodieSchemaConverter;
+import org.apache.hudi.util.StreamerUtil;
+import org.apache.hudi.utils.TestConfigurations;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.table.api.DataTypes;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.data.GenericRowData;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.StringData;
+import org.apache.flink.table.runtime.typeutils.RowDataSerializer;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.RowType;
+import org.apache.flink.types.RowKind;
+import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.mock;
+
+/** Real base-file and CDC-log coverage for both Flink CDC source 
implementations. */
+class TestCdcVectorRead {
+  private static final String INSTANT = "202609100";
+  private static final DataType DATA_TYPE = DataTypes.ROW(
+  DataTypes.FIELD("id", DataTypes.STRING().notNull()),
+  DataTypes.FIELD("embedding", 
DataTypes.ARRAY(DataTypes.FLOAT().notNull())),
+  DataTypes.FIELD("features", 
DataTypes.ARRAY(DataTypes.DOUBLE().notNull()).notNull()),
+  DataTypes.FIELD("values", DataTypes.ARRAY(DataTypes.INT(.notNull();
+
+  @TempDir
+  Path tempDir;
+
+  static Stream readCases() {
+List cases = new ArrayList<>();
+for (HoodieFileFormat format : Arrays.asList(HoodieFileFormat.PARQUET, 
HoodieFileFormat.LANCE)) {
+  for (boolean sourceV2 : new boolean[] {false, true}) {
+for (HoodieTableType 

Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


danny0405 commented on code in PR #19903:
URL: https://github.com/apache/hudi/pull/19903#discussion_r4022298117


##
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/source/reader/function/TestCdcVectorRead.java:
##
@@ -0,0 +1,382 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.source.reader.function;
+
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.model.FileSlice;
+import org.apache.hudi.common.model.HoodieBaseFile;
+import org.apache.hudi.common.model.HoodieFileFormat;
+import org.apache.hudi.common.model.HoodieTableType;
+import org.apache.hudi.common.schema.HoodieSchema;
+import org.apache.hudi.common.schema.HoodieSchemaUtils;
+import org.apache.hudi.common.table.HoodieTableConfig;
+import org.apache.hudi.common.table.HoodieTableMetaClient;
+import org.apache.hudi.common.table.HoodieTableVersion;
+import org.apache.hudi.common.table.cdc.HoodieCDCFileSplit;
+import org.apache.hudi.common.table.cdc.HoodieCDCInferenceCase;
+import org.apache.hudi.common.table.cdc.HoodieCDCSupplementalLoggingMode;
+import org.apache.hudi.common.table.cdc.HoodieCDCUtils;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.configuration.FlinkOptions;
+import org.apache.hudi.io.storage.row.HoodieRowDataFileWriter;
+import org.apache.hudi.io.storage.row.HoodieRowDataFileWriterFactory;
+import org.apache.hudi.source.reader.BatchRecords;
+import org.apache.hudi.source.split.HoodieCdcSourceSplit;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.format.InternalSchemaManager;
+import org.apache.hudi.table.format.cdc.CdcInputFormat;
+import org.apache.hudi.table.format.cdc.CdcInputSplit;
+import org.apache.hudi.table.format.mor.MergeOnReadTableState;
+import org.apache.hudi.util.DataTypeUtils;
+import org.apache.hudi.util.FlinkWriteClients;
+import org.apache.hudi.util.HoodieSchemaConverter;
+import org.apache.hudi.util.StreamerUtil;
+import org.apache.hudi.utils.TestConfigurations;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.table.api.DataTypes;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.data.GenericRowData;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.StringData;
+import org.apache.flink.table.runtime.typeutils.RowDataSerializer;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.RowType;
+import org.apache.flink.types.RowKind;
+import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.mock;
+
+/** Real base-file and CDC-log coverage for both Flink CDC source 
implementations. */
+class TestCdcVectorRead {
+  private static final String INSTANT = "202609100";
+  private static final DataType DATA_TYPE = DataTypes.ROW(
+  DataTypes.FIELD("id", DataTypes.STRING().notNull()),
+  DataTypes.FIELD("embedding", 
DataTypes.ARRAY(DataTypes.FLOAT().notNull())),
+  DataTypes.FIELD("features", 
DataTypes.ARRAY(DataTypes.DOUBLE().notNull()).notNull()),
+  DataTypes.FIELD("values", DataTypes.ARRAY(DataTypes.INT(.notNull();
+
+  @TempDir
+  Path tempDir;
+
+  static Stream readCases() {
+List cases = new ArrayList<>();
+for (HoodieFileFormat format : Arrays.asList(HoodieFileFormat.PARQUET, 
HoodieFileFormat.LANCE)) {
+  for (boolean sourceV2 : new boolean[] {false, true}) {
+for (HoodieTableType 

Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


hudi-agent commented on code in PR #19903:
URL: https://github.com/apache/hudi/pull/19903#discussion_r4020884528


##
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/mor/MergeOnReadInputFormat.java:
##
@@ -272,32 +278,43 @@ private void mayShiftInputSplit(MergeOnReadInputSplit 
split) throws IOException
 
   protected ClosableIterator getBaseFileIterator(String path) throws 
IOException {
 if (path.endsWith(HoodieFileFormat.LANCE.getFileExtension())) {
-  return FormatUtils.getLanceRecordIterator(path, fieldNames, fieldTypes, 
requiredPos, hadoopConf);
+  if (requiredSchema == null) {
+requiredSchema = 
HoodieSchemaCache.intern(HoodieSchema.parse(tableState.getRequiredSchema()));
+  }
+  return FormatUtils.getLanceRecordIterator(path, requiredSchema, 
hadoopConf);
+}
+
+if (readFieldTypes == null) {
+  HoodieSchema tableSchema = 
HoodieSchema.parse(tableState.getTableSchema());
+  vectorColumnInfo = VectorConversionUtils.detectVectorColumns(fieldNames, 
requiredPos, tableSchema);
+  readFieldTypes = 
VectorConversionUtils.getParquetReadFieldTypes(fieldNames, fieldTypes, 
tableSchema);
 }
 
 LinkedHashMap partObjects = 
FilePathUtils.generatePartitionSpecs(
 path,

Review Comment:
   πŸ€– nit: `tableSchema` here is parsed with `HoodieSchema.parse(...)` directly, 
but the equivalent code in `HoodieCdcSplitReaderFunction.getBaseFileIterator` 
wraps it with `HoodieSchemaCache.intern(...)`. Worth making these consistent so 
schema instances get interned the same way in both readers.
   
   ⚠️ AI-generated; verify before applying. React πŸ‘/πŸ‘Ž to flag 
quality.



##
hudi-common/src/main/java/org/apache/hudi/common/table/cdc/HoodieCDCUtils.java:
##
@@ -84,6 +86,32 @@ public static HoodieSchema schemaBySupplementalLoggingMode(
 }
   }
 
+  /**
+   * Validates that the table schema is compatible with the CDC supplemental 
logging mode.
+   *
+   * DATA_BEFORE and DATA_BEFORE_AFTER embed the table schema in the CDC 
record's
+   * {@code before}/{@code after} fields. This makes any VECTOR column a 
nested field,
+   * which is unsupported because VECTOR schemas and readers currently require 
top-level fields.
+   * OP_KEY_ONLY stores only the operation and record key, so images can be 
reconstructed
+   * from the original file slices without nesting VECTOR columns in the CDC 
schema.
+   *
+   * @param tableConfig table configuration containing the CDC settings
+   * @param tableSchema table schema to validate
+   * @throws HoodieNotSupportedException if CDC image logging is enabled for a 
schema containing VECTOR columns
+   */
+  public static void validateCdcSchema(HoodieTableConfig tableConfig, 
HoodieSchema tableSchema) {
+if (!tableConfig.isCDCEnabled() || 
tableConfig.cdcSupplementalLoggingMode() == 
HoodieCDCSupplementalLoggingMode.OP_KEY_ONLY) {
+  return;
+}

Review Comment:
   πŸ€– This looks resolved in the current revision: the check now lives in 
`createCDCSchema` (`validateCdcImageSchema`), which is only reached from the 
CDC logger/reader constructors with the record data schema after 
`removeMetadataFields`, so `initTable`/bootstrap with `NULL_SCHEMA` no longer 
hits `getFields()`. One trade-off worth noting for the PR description (which 
still mentions table-creation/`commitTableChange` validation): the rejection 
now surfaces at the first CDC write rather than at table creation.



##
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/reader/function/HoodieCdcSplitReaderFunction.java:
##
@@ -280,12 +285,19 @@ private ClosableIterator> 
getFileSliceHoodieRecordIterator
   /** Reads a CDC base file returning required-schema records. */
   private ClosableIterator getBaseFileIterator(String path) throws 
IOException {
 if (path.endsWith(HoodieFileFormat.LANCE.getFileExtension())) {
-  return FormatUtils.getLanceRecordIterator(
-  path, tableState.getRowType().getFieldNames(), fieldTypes, 
tableState.getRequiredPositions(), getHadoopConf());
+  if (requiredSchema == null) {
+requiredSchema = 
HoodieSchemaCache.intern(HoodieSchema.parse(tableState.getRequiredSchema()));
+  }
+  return FormatUtils.getLanceRecordIterator(path, requiredSchema, 
getHadoopConf());
+}
+
+if (readFieldTypes == null) {
+  HoodieSchema tableSchema = 
HoodieSchemaCache.intern(HoodieSchema.parse(tableState.getTableSchema()));
+  String[] fullFieldNames = 
tableState.getRowType().getFieldNames().toArray(new String[0]);
+  vectorColumnInfo = 
VectorConversionUtils.detectVectorColumns(fullFieldNames, 
tableState.getRequiredPositions(), tableSchema);
+  readFieldTypes = 
VectorConversionUtils.getParquetReadFieldTypes(fullFieldNames, 
fieldTypes.toArray(new DataType[0]), tableSchema);

Review Comment:
   πŸ€– nit: this lazy-init block (readFieldTypes/vectorColumnInfo computed once, 
cached in transient fields) 

Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5679020386

   
   ## CI report:
   
   * 979947bd991a652fa3ec1ea1e30324bebc7f3fd0 Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17114)
 
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5676570235

   
   ## CI report:
   
   * bb257ff92abce9170d96082105b0acbeca96de0f Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17004)
 
   * 979947bd991a652fa3ec1ea1e30324bebc7f3fd0 Azure: 
[PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17114)
 
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-15 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5676494757

   
   ## CI report:
   
   * bb257ff92abce9170d96082105b0acbeca96de0f Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17004)
 
   * 979947bd991a652fa3ec1ea1e30324bebc7f3fd0 UNKNOWN
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-11 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5631145120

   
   ## CI report:
   
   * cdd8544a1f6b1289a1ebe2431141a19c4a202157 Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17002)
 
   * bb257ff92abce9170d96082105b0acbeca96de0f UNKNOWN
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-11 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5631204783

   
   ## CI report:
   
   * cdd8544a1f6b1289a1ebe2431141a19c4a202157 Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17002)
 
   * bb257ff92abce9170d96082105b0acbeca96de0f Azure: 
[PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17004)
 
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-11 Thread via GitHub


hudi-agent commented on code in PR #19903:
URL: https://github.com/apache/hudi/pull/19903#discussion_r3988708517


##
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/reader/function/HoodieCdcSplitReaderFunction.java:
##
@@ -295,20 +307,23 @@ private ClosableIterator 
getBaseFileIterator(String path) throws IOExce
 conf.get(FlinkOptions.HIVE_STYLE_PARTITIONING)
 );
 
-return RecordIterators.getParquetRecordIterator(
+int[] requiredPositions = tableState.getRequiredPositions();
+ClosableIterator rows = RecordIterators.getParquetRecordIterator(
 internalSchemaManager,
 conf.get(FlinkOptions.READ_UTC_TIMEZONE),
 true,
 HadoopConfigurations.getParquetConf(conf, getHadoopConf()),
-fieldNames,
-fieldTypesArray,
+tableState.getRowType().getFieldNames().toArray(new String[0]),
+readFieldTypes,
 partObjects,
-tableState.getRequiredPositions(),
+requiredPositions,
 2048,
 new org.apache.flink.core.fs.Path(path),
 0,
 Long.MAX_VALUE,
 predicates);
+return vectorColumnInfo.isEmpty() ? rows
+: VectorConversionUtils.wrapVectorColumnIterator(rows, 
fieldTypes.toArray(new DataType[0]), requiredPositions, vectorColumnInfo);

Review Comment:
   πŸ€– nit: `fieldTypes.toArray(new DataType[0])` and the field-names `toArray` 
are rebuilt on every base file open (here, line 298, and line 316) β€” could you 
cache them as transient `String[]`/`DataType[]` fields alongside 
`readFieldTypes`, the way `MergeOnReadInputFormat` now does? That would also 
make the two implementations read the same.
   
   ⚠️ AI-generated; verify before applying. React πŸ‘/πŸ‘Ž to flag 
quality.



-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-11 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5632517325

   
   ## CI report:
   
   * bb257ff92abce9170d96082105b0acbeca96de0f Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17004)
 
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-10 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5629787885

   
   ## CI report:
   
   * cdd8544a1f6b1289a1ebe2431141a19c4a202157 Azure: 
[SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17002)
 
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-10 Thread via GitHub


hudi-agent commented on code in PR #19903:
URL: https://github.com/apache/hudi/pull/19903#discussion_r3985664216


##
hudi-common/src/main/java/org/apache/hudi/common/table/cdc/HoodieCDCUtils.java:
##
@@ -84,6 +86,32 @@ public static HoodieSchema schemaBySupplementalLoggingMode(
 }
   }
 
+  /**
+   * Validates that the table schema is compatible with the CDC supplemental 
logging mode.
+   *
+   * DATA_BEFORE and DATA_BEFORE_AFTER embed the table schema in the CDC 
record's
+   * {@code before}/{@code after} fields. This makes any VECTOR column a 
nested field,
+   * which is unsupported because VECTOR schemas and readers currently require 
top-level fields.
+   * OP_KEY_ONLY stores only the operation and record key, so images can be 
reconstructed
+   * from the original file slices without nesting VECTOR columns in the CDC 
schema.
+   *
+   * @param tableConfig table configuration containing the CDC settings
+   * @param tableSchema table schema to validate
+   * @throws HoodieNotSupportedException if CDC image logging is enabled for a 
schema containing VECTOR columns
+   */
+  public static void validateCdcSchema(HoodieTableConfig tableConfig, 
HoodieSchema tableSchema) {
+if (!tableConfig.isCDCEnabled() || 
tableConfig.cdcSupplementalLoggingMode() == 
HoodieCDCSupplementalLoggingMode.OP_KEY_ONLY) {
+  return;
+}
+for (HoodieSchemaField field : tableSchema.getNonNullType().getFields()) {
+  if (field.schema().getNonNullType().getType() == 
HoodieSchemaType.VECTOR) {
+throw new HoodieNotSupportedException("CDC supplemental logging mode " 
+ tableConfig.cdcSupplementalLoggingMode()
++ " is not supported for VECTOR column '" + field.name() + "'. Set 
"
++ HoodieTableConfig.CDC_SUPPLEMENTAL_LOGGING_MODE.key() + 
"=OP_KEY_ONLY or disable CDC.");
+  }

Review Comment:
   πŸ€– nit: `tableConfig.cdcSupplementalLoggingMode()` is called twice (once in 
the guard, once in the exception message) β€” might be worth pulling it into a 
local variable for clarity and to avoid the double lookup.
   
   ⚠️ AI-generated; verify before applying. React πŸ‘/πŸ‘Ž to flag 
quality.



##
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/reader/function/HoodieCdcSplitReaderFunction.java:
##
@@ -280,12 +285,19 @@ private ClosableIterator> 
getFileSliceHoodieRecordIterator
   /** Reads a CDC base file returning required-schema records. */
   private ClosableIterator getBaseFileIterator(String path) throws 
IOException {
 if (path.endsWith(HoodieFileFormat.LANCE.getFileExtension())) {
-  return FormatUtils.getLanceRecordIterator(
-  path, tableState.getRowType().getFieldNames(), fieldTypes, 
tableState.getRequiredPositions(), getHadoopConf());
+  if (requiredSchema == null) {
+requiredSchema = 
HoodieSchemaCache.intern(HoodieSchema.parse(tableState.getRequiredSchema()));
+  }
+  return FormatUtils.getLanceRecordIterator(path, requiredSchema, 
getHadoopConf());
+}
+
+if (readFieldTypes == null) {

Review Comment:
   πŸ€– nit: the lazy-init-on-null-check pattern for 
`readFieldTypes`/`vectorColumnInfo`/`requiredSchema` is duplicated almost 
verbatim in `MergeOnReadInputFormat.getBaseFileIterator` β€” could be worth a 
small shared helper to keep the two in sync as this evolves.
   
   ⚠️ AI-generated; verify before applying. React πŸ‘/πŸ‘Ž to flag 
quality.



##
hudi-common/src/main/java/org/apache/hudi/common/table/cdc/HoodieCDCUtils.java:
##
@@ -84,6 +86,32 @@ public static HoodieSchema schemaBySupplementalLoggingMode(
 }
   }
 
+  /**
+   * Validates that the table schema is compatible with the CDC supplemental 
logging mode.
+   *
+   * DATA_BEFORE and DATA_BEFORE_AFTER embed the table schema in the CDC 
record's
+   * {@code before}/{@code after} fields. This makes any VECTOR column a 
nested field,
+   * which is unsupported because VECTOR schemas and readers currently require 
top-level fields.
+   * OP_KEY_ONLY stores only the operation and record key, so images can be 
reconstructed
+   * from the original file slices without nesting VECTOR columns in the CDC 
schema.
+   *
+   * @param tableConfig table configuration containing the CDC settings
+   * @param tableSchema table schema to validate
+   * @throws HoodieNotSupportedException if CDC image logging is enabled for a 
schema containing VECTOR columns
+   */
+  public static void validateCdcSchema(HoodieTableConfig tableConfig, 
HoodieSchema tableSchema) {
+if (!tableConfig.isCDCEnabled() || 
tableConfig.cdcSupplementalLoggingMode() == 
HoodieCDCSupplementalLoggingMode.OP_KEY_ONLY) {
+  return;
+}

Review Comment:
   πŸ€– `getFields()` throws `IllegalStateException` for non-record schemas, and 
this is now reached from `validateAgainstTableProperties` on every `initTable`. 
Spark bootstrap (`HoodieSparkSqlWriter` with an empty df) creates the write 
client with `HoodieSchema.NULL_SCHEMA` and then 

Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-10 Thread via GitHub


codecov-commenter commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5628975253

   ## 
[Codecov](https://app.codecov.io/gh/apache/hudi/pull/19903?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `20.0%` with `12 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 80.20%. Comparing base 
([`8af07e1`](https://app.codecov.io/gh/apache/hudi/commit/8af07e1e1534c92e1ba97dbc1e18a50f73f6c65c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`cdd8544`](https://app.codecov.io/gh/apache/hudi/commit/cdd8544a1f6b1289a1ebe2431141a19c4a202157?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 4 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/hudi/pull/19903?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...g/apache/hudi/common/table/cdc/HoodieCDCUtils.java](https://app.codecov.io/gh/apache/hudi/pull/19903?src=pr&el=tree&filepath=hudi-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fhudi%2Fcommon%2Ftable%2Fcdc%2FHoodieCDCUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3RhYmxlL2NkYy9Ib29kaWVDRENVdGlscy5qYXZh)
 | 11.11% | [7 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/hudi/pull/19903?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[.../org/apache/hudi/client/BaseHoodieWriteClient.java](https://app.codecov.io/gh/apache/hudi/pull/19903?src=pr&el=tree&filepath=hudi-client%2Fhudi-client-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fhudi%2Fclient%2FBaseHoodieWriteClient.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aHVkaS1jbGllbnQvaHVkaS1jbGllbnQtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9odWRpL2NsaWVudC9CYXNlSG9vZGllV3JpdGVDbGllbnQuamF2YQ==)
 | 50.00% | [1 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/hudi/pull/19903?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...pache/hudi/common/table/HoodieTableMetaClient.java](https://app.codecov.io/gh/apache/hudi/pull/19903?src=pr&el=tree&filepath=hudi-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fhudi%2Fcommon%2Ftable%2FHoodieTableMetaClient.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3RhYmxlL0hvb2RpZVRhYmxlTWV0YUNsaWVudC5qYXZh)
 | 0.00% | [1 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/hudi/pull/19903?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   Additional details and impacted files
   
   
   
   ```diff
   @@ Coverage Diff  @@
   ## master   #19903  +/-   ##
   
   - Coverage 80.22%   80.20%   -0.02% 
   - Complexity3466934670   +1 
   
 Files  2546 2546  
 Lines142452   142466  +14 
 Branches  1733017336   +6 
   
   - Hits 114281   114268  -13 
   - Misses2026520287  +22 
   - Partials   7906 7911   +5 
   ```
   
   | 
[Components](https://app.codecov.io/gh/apache/hudi/pull/19903/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Ξ” | |
   |---|---|---|
   | 
[hudi-common](https://app.codecov.io/gh/apache/hudi/pull/19903/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | `83.79% <9.09%> (-0.06%)` | :arrow_down: |
   | 
[hudi-client](https://app.codecov.io/gh/apache/hudi/pull/19903/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | `83.30% <50.00%> (-0.02%)` | :arrow_down: |
   | 
[hudi-flink](https://app.codecov.io/gh/apache/hudi/pull/19903/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | `85.60% <ΓΈ> (-0.01%)` | :arrow_down: |
   | 

Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-10 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5628957810

   
   ## CI report:
   
   * cdd8544a1f6b1289a1ebe2431141a19c4a202157 Azure: 
[PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17002)
 
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]



Re: [PR] fix(flink): support vector columns in CDC reads [hudi]

2026-09-10 Thread via GitHub


hudi-bot commented on PR #19903:
URL: https://github.com/apache/hudi/pull/19903#issuecomment-5628916838

   
   ## CI report:
   
   * cdd8544a1f6b1289a1ebe2431141a19c4a202157 UNKNOWN
   
   
   Bot commands
 @hudi-bot supports the following commands:
   
- `@hudi-bot run azure` re-run the last Azure build
   


-- 
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]