ChaomingZhangCN commented on code in PR #438: URL: https://github.com/apache/paimon-cpp/pull/438#discussion_r4323973419
########## test/test_data/vortex/dedicated_vector_java_rolling.db/dedicated_vector_java_rolling/GenerateDedicatedVectorRollingFixture.java: ########## @@ -0,0 +1,174 @@ +/* + * 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. + */ + +import org.apache.paimon.catalog.Catalog; +import org.apache.paimon.catalog.CatalogContext; +import org.apache.paimon.catalog.CatalogFactory; +import org.apache.paimon.catalog.Identifier; +import org.apache.paimon.data.BinaryString; +import org.apache.paimon.data.BinaryVector; +import org.apache.paimon.data.GenericRow; +import org.apache.paimon.data.InternalRow; +import org.apache.paimon.io.DataFileMeta; +import org.apache.paimon.manifest.ManifestEntry; +import org.apache.paimon.options.Options; +import org.apache.paimon.schema.Schema; +import org.apache.paimon.table.FileStoreTable; +import org.apache.paimon.table.Table; +import org.apache.paimon.table.sink.BatchTableCommit; +import org.apache.paimon.table.sink.BatchTableWrite; +import org.apache.paimon.table.sink.BatchWriteBuilder; +import org.apache.paimon.table.source.ReadBuilder; +import org.apache.paimon.types.DataTypes; +import org.apache.paimon.utils.CloseableIterator; + +import java.util.Arrays; +import java.util.BitSet; +import java.util.Map; +import java.util.TreeMap; + +/** Generates one Java main file with independently rolled dedicated VECTOR files. */ Review Comment: Removed the Java generators and POMs from both fixtures. Kept the generated data and documented how to construct it in the READMEs. Fixed in 491279e. ########## test/test_data/vortex/dedicated_vector_java_rolling.db/dedicated_vector_java_rolling/README.md: ########## @@ -0,0 +1,128 @@ +<!-- +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. +--> + Review Comment: Simplified the READMEs to match the existing fixture style, covering the schema, options, data pattern, and commit/file layout. Fixed in 491279e. ########## src/paimon/core/core_options.cpp: ########## @@ -599,6 +601,15 @@ struct CoreOptions::Impl { // Parse file.format - data file format, default "parquet" PAIMON_RETURN_NOT_OK(parser.ParseObject<FileFormatFactory>( Options::FILE_FORMAT, /*default_identifier=*/"parquet", &file_format)); + if (parser.ContainsKey(Options::VECTOR_FILE_FORMAT)) { + PAIMON_RETURN_NOT_OK(parser.ParseObject<FileFormatFactory>( + Options::VECTOR_FILE_FORMAT, /*default_identifier=*/"vortex", &vector_file_format)); + } + PAIMON_RETURN_NOT_OK( + parser.ParseMemorySize(Options::VECTOR_TARGET_FILE_SIZE, &vector_target_file_size)); + if (vector_target_file_size && vector_target_file_size.value() <= 0) { + return Status::Invalid("vector.target-file-size must be positive"); + } Review Comment: Added tests for the default and explicitly configured values of both VECTOR options in TestDefaultValue and TestFromMap. Fixed in 491279e. ########## src/paimon/core/schema/schema_validation.cpp: ########## @@ -1261,6 +1263,58 @@ Status SchemaValidation::ValidateMapStorageLayout(const TableSchema& schema, return Status::OK(); } +Status SchemaValidation::ValidateVectorStore(const TableSchema& schema, + const CoreOptions& options) { + const std::shared_ptr<FileFormat> vector_format = options.GetVectorFileFormat(); + if (!vector_format) { + return Status::OK(); + } + if (vector_format->Identifier() != "vortex") { + return Status::NotImplemented("Dedicated VECTOR storage currently only supports vortex"); Review Comment: Removed the Vortex-only restriction and added parameterized tests for Parquet, Lance, and Vortex. Parquet and Vortex passed locally; Lance runtime tests were not run locally. Fixed in 491279e. -- 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]
