flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-8139) Check for proper equals() and hashCode() when registering a table
Date Fri, 08 Dec 2017 10:32:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-8139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16283319#comment-16283319
] 

ASF GitHub Bot commented on FLINK-8139:
---------------------------------------

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

    https://github.com/apache/flink/pull/5065#discussion_r155746766
  
    --- 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 --
    
    I will do this.


> Check for proper equals() and hashCode() when registering a table
> -----------------------------------------------------------------
>
>                 Key: FLINK-8139
>                 URL: https://issues.apache.org/jira/browse/FLINK-8139
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Aegeaner
>
> In the current Table API & SQL implementation we compare {{Row}}s at different positions.
E.g., for joining we test rows for equality or put them into state. A heap state backend requires
proper hashCode() and equals() in order to work correct. Thus, every type in the Table API
needs to have these methods implemented.
> We need to check if all fields of a row have implement methods that differ from {{Object.equals()}}
and {{Object.hashCode()}} via reflections. Both coming from TableSource and DataStream/DataSet.
> Additionally, for array types, the {{Row}} class should use {{Arrays.deepEquals()}} and
{{Arrays.deepHashCode()}} instead of the non-deep variants.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message