Github user wuchong commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3039#discussion_r93757999
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
 ---
    @@ -340,25 +331,8 @@ abstract class TableEnvironment(val config: 
TableConfig) {
         * @return A tuple of two arrays holding the field names and 
corresponding field positions.
         */
       protected[flink] def getFieldInfo[A](inputType: TypeInformation[A]):
    -      (Array[String], Array[Int]) =
    -  {
    -    validateType(inputType)
    -
    -    val fieldNames: Array[String] = inputType match {
    -      case t: TupleTypeInfo[A] => t.getFieldNames
    -      case c: CaseClassTypeInfo[A] => c.getFieldNames
    -      case p: PojoTypeInfo[A] => p.getFieldNames
    -      case r: RowTypeInfo => r.getFieldNames
    -      case tpe =>
    -        throw new TableException(s"Type $tpe lacks explicit field naming")
    -    }
    -    val fieldIndexes = fieldNames.indices.toArray
    -
    -    if (fieldNames.contains("*")) {
    -      throw new TableException("Field name can not be '*'.")
    -    }
    -
    -    (fieldNames, fieldIndexes)
    +  (Array[String], Array[Int]) = {
    +    TableEnvironment.getFieldInfo(inputType)
    --- End diff --
    
    It seems that this is redundant, we can remove this and use the util 
`getFieldInfo` instead of calling this method.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to