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/06/17 09:25:07 UTC

[GitHub] [flink] sunjincheng121 commented on a change in pull request #8664: [FLINK-12779][table] Avoid field conflicts when generate field names for non-composite Typeinformation

sunjincheng121 commented on a change in pull request #8664: [FLINK-12779][table] Avoid field conflicts when generate field names for non-composite Typeinformation
URL: https://github.com/apache/flink/pull/8664#discussion_r294208184
 
 

 ##########
 File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/typeutils/FieldInfoUtils.java
 ##########
 @@ -186,6 +186,37 @@ public static boolean isReferenceByPosition(CompositeType<?> ct, Expression[] fi
 		return fieldNames;
 	}
 
+	/**
+	 * Returns field names for a given {@link TypeInformation}. If the input {@link TypeInformation}
+	 * is not a composite type, the result field name should not exist in the invalidNamesForNonCompositeType.
+	 *
+	 * @param inputType The TypeInformation extract the field names.
+	 * @param invalidNamesForNonCompositeType The invalid field names for non-composite types.
+	 * @param <A> The type of the TypeInformation.
+	 * @return An array holding the field names
+	 */
+	public static <A> String[] getFieldNames(TypeInformation<A> inputType, List<String> invalidNamesForNonCompositeType) {
 
 Review comment:
   I think adding a new method with the difference prams is pretty good. but the impl logic can be merged into one method! i.e.:
   public static <A> String[] getFieldNames(TypeInformation<A> inputType) {
   getFieldNames(inputType, Collections.emptyList());
   }
   public static <A> String[] getFieldNames(TypeInformation<A> inputType, List<String> existingNames) {
   ...
   }
   Whtat do you think?
   

----------------------------------------------------------------
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