Feat: Add byte size to TTypedesc in TExpr. Which will be used to carry scalarType information. (#17757)

Co-authored-by: libinfeng <libinfeng@selectdb.com>
This commit is contained in:
LiBinfeng
2023-03-15 08:24:32 +08:00
committed by GitHub
parent 7872f3626a
commit 9b047d2c94
8 changed files with 40 additions and 4 deletions

View File

@ -80,6 +80,20 @@ public class ScalarType extends Type {
public static final int DEFAULT_MIN_AVG_DECIMAL128_SCALE = 4;
public static final int MAX_DATETIMEV2_SCALE = 6;
private long byteSize = -1;
/**
* Set byte size of expression
*/
public void setByteSize(long byteSize) {
this.byteSize = byteSize;
}
public long getByteSize() {
return byteSize;
}
private static final Logger LOG = LogManager.getLogger(ScalarType.class);
@SerializedName(value = "type")
private final PrimitiveType type;
@ -638,6 +652,7 @@ public class ScalarType extends Type {
node.setType(TTypeNodeType.SCALAR);
TScalarType scalarType = new TScalarType();
scalarType.setType(type.toThrift());
container.setByteSize(byteSize);
switch (type) {
case VARCHAR: