You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tw...@apache.org on 2020/07/14 08:55:58 UTC

[flink] branch release-1.11 updated (68292a8 -> f70e0b8)

This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a change to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from 68292a8  [FLINK-18593][doc] Hive bundle jar URLs are broken
     new bbe65db  [hotfix][table-planner-blink] Fix digest for inline structured types with generics
     new f70e0b8  [hotfix][table-planner-blink] Fix row size estimation for structured types

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../table/planner/plan/schema/StructuredRelDataType.java      | 11 ++++++++++-
 .../flink/table/planner/plan/metadata/FlinkRelMdSize.scala    |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)


[flink] 02/02: [hotfix][table-planner-blink] Fix row size estimation for structured types

Posted by tw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git

commit f70e0b86c037f11f8d41e703131604c3909ac7e3
Author: Timo Walther <tw...@apache.org>
AuthorDate: Mon Jul 13 14:31:59 2020 +0200

    [hotfix][table-planner-blink] Fix row size estimation for structured types
---
 .../org/apache/flink/table/planner/plan/metadata/FlinkRelMdSize.scala   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdSize.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdSize.scala
index d3fa169..c4debe0 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdSize.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdSize.scala
@@ -390,7 +390,7 @@ object FlinkRelMdSize {
     BuiltInMethod.AVERAGE_ROW_SIZE.method)
 
   def averageTypeValueSize(t: RelDataType): JDouble = t.getSqlTypeName match {
-    case SqlTypeName.ROW =>
+    case SqlTypeName.ROW | SqlTypeName.STRUCTURED =>
       estimateRowSize(t)
     case SqlTypeName.ARRAY =>
       // 16 is an arbitrary estimate


[flink] 01/02: [hotfix][table-planner-blink] Fix digest for inline structured types with generics

Posted by tw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git

commit bbe65db8b6a4c02f1df969ca7f68e5f61df31cf0
Author: Timo Walther <tw...@apache.org>
AuthorDate: Mon Jul 13 14:28:14 2020 +0200

    [hotfix][table-planner-blink] Fix digest for inline structured types with generics
---
 .../table/planner/plan/schema/StructuredRelDataType.java      | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/schema/StructuredRelDataType.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/schema/StructuredRelDataType.java
index 4593a28..614b310 100644
--- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/schema/StructuredRelDataType.java
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/schema/StructuredRelDataType.java
@@ -35,6 +35,7 @@ import org.apache.calcite.sql.type.SqlTypeName;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * The {@link RelDataType} representation of a {@link StructuredType}.
@@ -98,9 +99,17 @@ public final class StructuredRelDataType extends ObjectSqlType {
 				sb.append(structuredType.asSerializableString());
 			}
 			// in case of inline structured type we are using a temporary identifier
+			// that includes both the implementation class plus its children for cases with classes
+			// that use generics
 			else {
 				sb.append(structuredType.asSummaryString());
-				if (structuredType.isNullable()) {
+				sb.append("(");
+				sb.append(
+					fieldList.stream()
+						.map(field -> field.getType().getFullTypeString())
+						.collect(Collectors.joining(", ")));
+				sb.append(")");
+				if (!structuredType.isNullable()) {
 					sb.append(" NOT NULL");
 				}
 			}