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

    https://github.com/apache/flink/pull/5065#discussion_r154965051
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
 ---
    @@ -721,6 +722,42 @@ abstract class TableEnvironment(val config: 
TableConfig) {
         */
       protected def checkValidTableName(name: String): Unit
     
    +  /**
    +    * Checks if the chosen table type is valid.
    +    * @param table The table to check
    +    */
    +  protected def checkValidTableType(table: Table): Unit = {
    +    val types = table.getSchema.getTypes
    +    checkTypeArray(types)
    +  }
    +
    +  private def checkTypeArray(types: Array[TypeInformation[_]]) = {
    +    for (typeInfo <- types) {
    +      if(!typeInfo.asInstanceOf[TypeInformation[_]].isBasicType &&
    +        !typeInfo.isInstanceOf[PrimitiveArrayTypeInfo[_]]) {
    --- End diff --
    
    Also add `BasicArrayTypeInfo` and `ObjectArrayTypeInfo`. For 
`ObjectArrayTypeInfo` we need to check the component types as well.


---

Reply via email to