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:
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user