JackieTien97 commented on code in PR #613: URL: https://github.com/apache/tsfile/pull/613#discussion_r2476168929
########## java/tsfile/src/main/java/org/apache/tsfile/read/common/type/ObjectType.java: ########## @@ -0,0 +1,79 @@ +/* + * 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.tsfile.read.common.type; + +import org.apache.tsfile.block.column.Column; +import org.apache.tsfile.block.column.ColumnBuilder; +import org.apache.tsfile.read.common.block.column.BinaryColumnBuilder; +import org.apache.tsfile.utils.Binary; + +import java.util.Collections; +import java.util.List; + +public class ObjectType extends AbstractType { + + public static final ObjectType OBJECT = new ObjectType(); + + private ObjectType() {} + + @Override + public Binary getBinary(Column c, int position) { + return c.getBinary(position); + } + + @Override + public void writeBinary(ColumnBuilder builder, Binary value) { + builder.writeBinary(value); + } + + @Override + public ColumnBuilder createColumnBuilder(int expectedEntries) { + return new BinaryColumnBuilder(null, expectedEntries); + } + + @Override + public TypeEnum getTypeEnum() { + return TypeEnum.OBJECT; + } + + @Override + public String getDisplayName() { + return "OBJECT"; + } + + @Override + public boolean isComparable() { + return true; + } + + @Override + public boolean isOrderable() { + return true; Review Comment: ```suggestion return false; ``` we think object type is not orderable, that means it can't used in order by clause ########## java/common/src/main/java/org/apache/tsfile/enums/TSDataType.java: ########## @@ -558,14 +579,19 @@ public boolean isComparable() { return true; case VECTOR: case BLOB: + case OBJECT: return false; default: throw new UnSupportedDataTypeException(this.toString()); } } public boolean isBinary() { - return this == TEXT || this == STRING || this == BLOB; + return this == TEXT || this == STRING || this == BLOB || this == OBJECT; + } + + public boolean isBlob() { + return this == BLOB || this == OBJECT; Review Comment: A little bit confusing? Actually, OBJECT is totaly different from BLOB in their storage. maybe we need to change the function name and add some java doc about what this metod is ued to? -- 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]
