You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/03/08 01:57:08 UTC
[GitHub] [flink] KurtYoung commented on a change in pull request #7931:
[FLINK-11854] [table-planner-blink] Introduce batch physical nodes
KurtYoung commented on a change in pull request #7931: [FLINK-11854] [table-planner-blink] Introduce batch physical nodes
URL: https://github.com/apache/flink/pull/7931#discussion_r263639880
##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryRow.java
##########
@@ -63,6 +91,22 @@ public static int calculateFixPartSizeInBytes(int arity) {
return calculateBitSetWidthInBytes(arity) + 8 * arity;
}
+ /**
+ * If it is a fixed-length field, we can call this BinaryRow's setXX method for in-place updates.
+ * If it is variable-length field, can't use this method, because the underlying data is stored continuously.
+ */
+ public static boolean isFixedLength(InternalType type) {
+ if (type instanceof DecimalType) {
+ return ((DecimalType) type).precision() <= DecimalType.MAX_COMPACT_PRECISION;
+ } else {
+ return MUTABLE_FIELD_TYPES.contains(type);
+ }
+ }
+
+ public static boolean isMutable(InternalType type) {
+ return MUTABLE_FIELD_TYPES.contains(type) || type instanceof DecimalType;
Review comment:
do we also need to check Decimal's precision just like `isFixedLength` does?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services