wuchong commented on code in PR #1370:
URL: https://github.com/apache/fluss/pull/1370#discussion_r2265281509


##########
fluss-common/src/main/java/com/alibaba/fluss/memory/InputView.java:
##########
@@ -29,7 +30,7 @@
  * @since 0.2
  */
 @PublicEvolving
-public interface InputView {
+public interface InputView extends DataInput {

Review Comment:
   Please see the Javadoc, the `InputView` is in little endian, but `DataInput` 
is in big endian. Making `InputView` extends `DataInput` breaks the API 
semantics and is error-prone. 



##########
fluss-common/src/main/java/com/alibaba/fluss/utils/InternalRowUtils.java:
##########
@@ -0,0 +1,114 @@
+/*
+ * 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 com.alibaba.fluss.utils;
+
+import com.alibaba.fluss.row.BinaryRow;
+import com.alibaba.fluss.row.BinaryString;
+import com.alibaba.fluss.row.DataGetters;
+import com.alibaba.fluss.row.Decimal;
+import com.alibaba.fluss.row.GenericRow;
+import com.alibaba.fluss.row.InternalRow;
+import com.alibaba.fluss.types.DataType;
+import com.alibaba.fluss.types.DecimalType;
+import com.alibaba.fluss.types.LocalZonedTimestampType;
+import com.alibaba.fluss.types.RowType;
+import com.alibaba.fluss.types.TimestampType;
+
+import static com.alibaba.fluss.types.DataTypeChecks.getLength;
+
+/** InternalRowUtils. */
+public class InternalRowUtils {

Review Comment:
   not used, please remove. Please introduce when it is needed. 



##########
fluss-common/src/main/java/com/alibaba/fluss/memory/OutputView.java:
##########
@@ -28,7 +29,7 @@
  * @since 0.2
  */
 @PublicEvolving
-public interface OutputView {
+public interface OutputView extends DataOutput {

Review Comment:
   ditto



##########
fluss-common/src/main/java/com/alibaba/fluss/memory/AbstractPagedInputView.java:
##########
@@ -0,0 +1,545 @@
+/*
+ * 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 com.alibaba.fluss.memory;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.UTFDataFormatException;
+
+/**
+ * The base class for all input views that are backed by multiple memory 
pages. This base class
+ * contains all decoding methods to read data from a page and detect page 
boundary crossing. The
+ * concrete sub classes must implement the methods to provide the next memory 
page once the boundary
+ * is crossed.
+ */
+public abstract class AbstractPagedInputView implements InputView {

Review Comment:
   Why introduce `AbstractPagedInputView`? I think in our case, we don't have 
paged `MemroySegment`s as `InputView`. Do not introduce interfaces that we 
won't use in the near future. 



##########
fluss-common/src/main/java/com/alibaba/fluss/types/MultisetType.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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 com.alibaba.fluss.types;
+
+import com.alibaba.fluss.annotation.PublicEvolving;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+import static com.alibaba.fluss.utils.Preconditions.checkNotNull;
+
+/**
+ * Data type of a multiset (=bag). Unlike a set, it allows for multiple 
instances for each of its
+ * elements with a common subtype. Each unique value (including {@code NULL}) 
is mapped to some
+ * multiplicity. There is no restriction of element types; it is the 
responsibility of the user to
+ * ensure uniqueness.
+ *
+ * <p>A conversion is possible through a map that assigns each value to an 
integer multiplicity
+ * ({@code Map<t, Integer>}).
+ *
+ * @since 0.8
+ */
+@PublicEvolving
+public class MultisetType extends DataType {

Review Comment:
   Please remove the `MultisetType` and `VarBinaryType` and `VarCharType`. 
    - MultisetType can be represented as MapType, and we should support MapType 
first, otherwise the `MultisetType` is not able to be used.
    - We already have `BytesType` and `StringType` which can represent the 
`VarBinaryType` and `VarCharType`. 
    - Variable-length types often require the storage layer to enforce length 
constraints (e.g., `VARCHAR(255)`), which is not currently supported by Fluss. 
Given that such constraints are rarely used in analytical workloads, the 
practical value of these types is limited in our target scenarios.
   



##########
fluss-common/src/main/java/com/alibaba/fluss/memory/OutputView.java:
##########
@@ -28,7 +29,7 @@
  * @since 0.2
  */
 @PublicEvolving
-public interface OutputView {
+public interface OutputView extends DataOutput {

Review Comment:
   ditto



##########
fluss-common/src/main/java/com/alibaba/fluss/row/serializer/BinarySerializer.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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 com.alibaba.fluss.row.serializer;
+
+import com.alibaba.fluss.memory.InputView;
+import com.alibaba.fluss.memory.OutputView;
+
+import java.io.IOException;
+
+import static com.alibaba.fluss.utils.VarLengthIntUtils.decodeInt;
+import static com.alibaba.fluss.utils.VarLengthIntUtils.encodeInt;
+
+/** Type serializer for {@code byte[]}. */
+public final class BinarySerializer extends SerializerSingleton<byte[]> {

Review Comment:
   Why introduce the set of serializer? Currentlly, `IndexRowWriter` and 
`ComapctedRowWriter` and `ArrowWriter` have different serialization format for 
each data type, therefore, we don't have a shared serializer for the types. 



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

Reply via email to