Hi. It will also influence how Flink serialize/deserialize the RowData. For example, Flink will build the TimestampDataSerializer with specified precision in the type. You can see it only extract the expected part to serialize[1]. But for char/varchar type, the serializer will not truncate the string if it exceeds the specified length when serialize/deserialize the RowData.
Best, Shengkai [1] https://github.com/apache/flink/blob/master/flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/typeutils/TimestampDataSerializer.java#L108 yuxia <luoyu...@alumni.sjtu.edu.cn> 于2022年5月25日周三 20:58写道: > IMO, the behaviors depends on how you convert your string data from extern > system to Flink's intern data or, conversely. > > I think it's more like a hint to tell how to convert the string data > between extern system including source and sink. > > > Best regards, > Yuxia > > ------------------------------ > *发件人: *"Krzysztof Chmielewski" <krzysiek.chmielew...@gmail.com> > *收件人: *"User" <user@flink.apache.org> > *发送时间: *星期三, 2022年 5 月 25日 下午 5:29:10 > *主题: *length value for some classes extending LogicalType. > > Hi, > some classes extending LogicalType.java such as VarCharType, BinaryType, > CharType and few others have an optional argument "length". If not > specified, length is set to default value which is 1. > > I would like to ask, what are the implications of that? What can happen if > I use the default length value 1 but the actual length of the data will be > bigger than 1? > > For example: > RowType.of("col1", new CharType()) <- this will use default length value 1. > > Regards, > Krzysztof Chmielewski > >