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-3036) Gelly's Graph.fromCsvReader method returns wrongly parameterized Graph
Date Tue, 17 Nov 2015 20:46:10 GMT

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

ASF GitHub Bot commented on FLINK-3036:

Github user vasia commented on the pull request:

    Thanks a lot for fixing this @tillrohrmann!
    I actually like the new behavior better ;) Could you please also update the gelly guide?
    One more thing, some of the formatting changes you've made are also present in #1356.
I was planning to merge it, but you'll have to rebase this one. Let me know if that's OK or
whether it's more convenient for you to merge #1356 and this one yourself. Thanks again!

> Gelly's Graph.fromCsvReader method returns wrongly parameterized Graph
> ----------------------------------------------------------------------
>                 Key: FLINK-3036
>                 URL: https://issues.apache.org/jira/browse/FLINK-3036
>             Project: Flink
>          Issue Type: Bug
>          Components: Gelly
>    Affects Versions: 0.10.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
> The Scala method {{Graph.fromCsvReader}} of Gelly returns a wrongly typed {{Graph}} instance.
The problem is that no return type has been explicitly defined for the method. Additionally,
the method returns fundamentally incompatible types depending on the given parameters. So
for example, the method can return a {{Graph[Long, Long, Long]}} if a vertex and edge file
is specified (in this case with value type {{Long}}). If the vertex file is not specified
and neither a vertex value initializer, then the return type is {{Graph[Long, NullValue, Long]}}.
Since {{NullValue}} and {{Long}} have nothing in common, Scala's type inference infers that
the {{fromCsvReader}} method must have a return type {{Graph[Long, t  >: Long with NullValue,
Long]}} with {{t}} being a supertype of {{Long with NullValue}}. This type is not useful at
all, since there is no such type. As a consequence, the user has to cast the resulting {{Graph}}
to have either the type {{Graph[Long, NullValue, Long]}} or {{Graph[Long, Long, Long]}} if
he wants to do something more elaborate than just collecting the edges for example. 
> This can be especially confusing because one usually writes something like
> {code}
> val graph = Graph.fromCsvReader[Long, Double, Double](...)
> graph.run(new PageRank(...))
> {code}
> and does not see that the type of {{graph}} is {{Graph[Long, t >: Double with NullValue,
u >: Double with NullValue}}.

This message was sent by Atlassian JIRA

View raw message