rdblue commented on code in PR #3202: URL: https://github.com/apache/parquet-java/pull/3202#discussion_r2069554859
########## parquet-variant/src/main/java/org/apache/parquet/variant/VariantObjectBuilder.java: ########## @@ -0,0 +1,49 @@ +/* + * 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.parquet.variant; + +import java.util.ArrayList; + +/** + * Builder for creating Variant object, used by VariantBuilder. + */ +public class VariantObjectBuilder { Review Comment: I think that this builder should be used for both keys and values so that it can help verify that there are the same number of keys and values. Right now, there is no checking and it isn't clear when values should be added. Meaning the API doesn't help show me that `appendKey` should be interleaved with `appendSomeValue` calls. If I leave out the `appendSomeValue` call then things break. I think there should be checks in this API that ensure correct object construction. There should probably also be tests for the weird cases. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
