flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twalthr <...@git.apache.org>
Subject [GitHub] flink pull request #2094: [FLINK-3702] Make FieldAccessors support nested fi...
Date Tue, 23 Aug 2016 10:23:09 GMT
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2094#discussion_r75839040
  
    --- Diff: flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/CaseClassTypeInfo.scala
---
    @@ -236,6 +237,31 @@ abstract class CaseClassTypeInfo[T <: Product](
         }
       }
     
    +  override def getFieldAccessor[F](pos: Int, config: ExecutionConfig): FieldAccessor[T,
F] = {
    +    new ProductFieldAccessor[T,F,F](
    +      pos, this, new SimpleFieldAccessor[F](types(pos).asInstanceOf[TypeInformation[F]]),
config)
    +  }
    +
    +  override def getFieldAccessor[F](fieldExpression: String, config: ExecutionConfig):
    +    FieldAccessor[T, F] = {
    +
    +    val decomp = FieldAccessor.decomposeFieldExpression(fieldExpression)
    +
    +    val pos = getFieldIndex(decomp.head)
    +    if(pos == -2) {
    --- End diff --
    
    Would `-1` be a valid index? I think this should be `< 0`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message