twalthr commented on a change in pull request #11925:
URL: https://github.com/apache/flink/pull/11925#discussion_r416366975



##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/GenericRowData.java
##########
@@ -186,6 +187,20 @@ public RowData getRow(int pos, int numFields) {
                return (RowData) this.fields[pos];
        }
 
+       @Override
+       public String toString() {
+               StringBuilder sb = new StringBuilder();
+               sb.append(kind.shortString()).append("(");
+               for (int i = 0; i < fields.length; i++) {
+                       if (i != 0) {
+                               sb.append(",");
+                       }
+                       sb.append(StringUtils.arrayAwareToString(fields[i]));

Review comment:
       Use `org.apache.flink.table.utils.EncodingUtils#objectToString`

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeUtils.java
##########
@@ -36,6 +43,54 @@ public static LogicalType removeTimeAttributes(LogicalType 
logicalType) {
                return logicalType.accept(TIME_ATTRIBUTE_REMOVER);
        }
 
+       /**
+        * Get internal(sql engine execution data formats) conversion class for 
{@link LogicalType}.
+        */
+       public static Class<?> internalConversionClass(LogicalType type) {
+               switch (type.getTypeRoot()) {
+                       case BOOLEAN:
+                               return Boolean.class;
+                       case TINYINT:
+                               return Byte.class;
+                       case SMALLINT:
+                               return Short.class;
+                       case INTEGER:
+                       case DATE:
+                       case TIME_WITHOUT_TIME_ZONE:
+                       case INTERVAL_YEAR_MONTH:
+                               return Integer.class;
+                       case BIGINT:
+                       case INTERVAL_DAY_TIME:
+                               return Long.class;
+                       case TIMESTAMP_WITHOUT_TIME_ZONE:
+                       case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
+                               return TimestampData.class;
+                       case FLOAT:
+                               return Float.class;
+                       case DOUBLE:
+                               return Double.class;
+                       case CHAR:
+                       case VARCHAR:
+                               return StringData.class;
+                       case DECIMAL:
+                               return DecimalData.class;
+                       case ARRAY:
+                               return ArrayData.class;
+                       case MAP:
+                       case MULTISET:
+                               return MapData.class;
+                       case ROW:
+                               return RowData.class;
+                       case BINARY:
+                       case VARBINARY:
+                               return byte[].class;
+                       case RAW:
+                               return RawValueData.class;
+                       default:
+                               throw new UnsupportedOperationException("Not 
support type: " + type);

Review comment:
       nit: `Unsupported type:`

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeUtils.java
##########
@@ -36,6 +43,54 @@ public static LogicalType removeTimeAttributes(LogicalType 
logicalType) {
                return logicalType.accept(TIME_ATTRIBUTE_REMOVER);
        }
 
+       /**
+        * Get internal(sql engine execution data formats) conversion class for 
{@link LogicalType}.

Review comment:
       nit: `Returns the conversion class for the given {@link LogicalType} 
that is used by the table runtime.`

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/AsyncTableFunction.java
##########
@@ -55,7 +55,7 @@
  * runtime.
  *
  * <p>By default the result type of an evaluation method is determined by 
Flink's type extraction
- * facilities. Currently, only support {@link org.apache.flink.types.Row} and 
{@code BaseRow} as
+ * facilities. Currently, only support {@link org.apache.flink.types.Row} and 
{@code RowData} as

Review comment:
       use: `{@link RowData}`

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeUtils.java
##########
@@ -36,6 +43,54 @@ public static LogicalType removeTimeAttributes(LogicalType 
logicalType) {
                return logicalType.accept(TIME_ATTRIBUTE_REMOVER);
        }
 
+       /**
+        * Get internal(sql engine execution data formats) conversion class for 
{@link LogicalType}.
+        */
+       public static Class<?> internalConversionClass(LogicalType type) {

Review comment:
       nit: `toInternalConversionClass`




----------------------------------------------------------------
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:
[email protected]


Reply via email to