You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by ggevay <gi...@git.apache.org> on 2015/10/02 12:27:06 UTC

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

GitHub user ggevay opened a pull request:

    https://github.com/apache/flink/pull/1212

    [FLINK-2806] [scala-api] Add a TypeInformation[Nothing].

    I added a TypeInfo[Nothing] class, and added a line to workaround the compiler bug. I also added a test for this, which tests at compile time: if the "implicit val scalaNothingTypeInfo" is not there, then it does not compile.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ggevay/flink typeInfo-nothing

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1212.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1212
    
----
commit a73a96a5de5a271ed4a3ca55aea14c34072aa7e7
Author: Gabor Gevay <gg...@gmail.com>
Date:   2015-10-02T08:14:01Z

    [FLINK-2806] [scala-api] Add a TypeInformation[Nothing].

----


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

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

Posted by ggevay <gi...@git.apache.org>.
Github user ggevay commented on the pull request:

    https://github.com/apache/flink/pull/1212#issuecomment-145501103
  
    Thanks, I have changed the hashCode.


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

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1212#discussion_r41125339
  
    --- Diff: flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/ScalaNothingTypeInfo.scala ---
    @@ -0,0 +1,47 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.api.scala.typeutils
    +
    +import org.apache.flink.api.common.ExecutionConfig
    +import org.apache.flink.api.common.typeinfo.TypeInformation
    +import org.apache.flink.api.common.typeutils.TypeSerializer
    +
    +class ScalaNothingTypeInfo extends TypeInformation[Nothing] {
    +
    +  override def isBasicType: Boolean = false
    +  override def isTupleType: Boolean = false
    +  override def getArity: Int = 0
    +  override def getTotalFields: Int = 0
    +  override def getTypeClass: Class[Nothing] = classOf[Nothing]
    +  override def isKeyType: Boolean = false
    +
    +  override def createSerializer(config: ExecutionConfig): TypeSerializer[Nothing] =
    +    (new NothingSerializer).asInstanceOf[TypeSerializer[Nothing]]
    +
    +  override def hashCode(): Int = 42
    --- End diff --
    
    Could we use `classOf[ScalaNothingTypeInfo].hashCode` here? Otherwise, all objects we create end up in the bucket with hash code `42`.


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

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/1212


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

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

Posted by chiwanpark <gi...@git.apache.org>.
Github user chiwanpark commented on the pull request:

    https://github.com/apache/flink/pull/1212#issuecomment-146213445
  
    +1 for merging. If there is no objection, I'll merge this in few hours.


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

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the pull request:

    https://github.com/apache/flink/pull/1212#issuecomment-145476115
  
    LGTM. Only one minor comment.


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

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

Posted by chiwanpark <gi...@git.apache.org>.
Github user chiwanpark commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1212#discussion_r41009352
  
    --- Diff: flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeInformationGen.scala ---
    @@ -23,6 +23,7 @@ import org.apache.flink.api.common.ExecutionConfig
     import org.apache.flink.api.common.typeinfo._
     import org.apache.flink.api.common.typeutils._
     import org.apache.flink.api.java.typeutils._
    +import org.apache.flink.api.scala.typeutils.ScalaNothingTypeInfo
     import org.apache.flink.api.scala.typeutils.{CaseClassSerializer, CaseClassTypeInfo}
    --- End diff --
    
    Maybe we can merge two import lines.


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

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on the pull request:

    https://github.com/apache/flink/pull/1212#issuecomment-145462515
  
    Looks good to me. @tillrohrmann can you have a quick look? You recently did some work on the TypeInformation and TypeSerializers.


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

[GitHub] flink pull request: [FLINK-2806] [scala-api] Add a TypeInformation...

Posted by ggevay <gi...@git.apache.org>.
Github user ggevay commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1212#discussion_r41014072
  
    --- Diff: flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeInformationGen.scala ---
    @@ -23,6 +23,7 @@ import org.apache.flink.api.common.ExecutionConfig
     import org.apache.flink.api.common.typeinfo._
     import org.apache.flink.api.common.typeutils._
     import org.apache.flink.api.java.typeutils._
    +import org.apache.flink.api.scala.typeutils.ScalaNothingTypeInfo
     import org.apache.flink.api.scala.typeutils.{CaseClassSerializer, CaseClassTypeInfo}
    --- End diff --
    
    Thx, done.


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