Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix data structure for nebula datasource #30

Merged
merged 1 commit into from
Dec 23, 2021

Conversation

Nicole00
Copy link
Contributor

No description provided.

@jievince jievince merged commit 67d9396 into vesoft-inc:master Dec 23, 2021
Copy link

@caton-hpg caton-hpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.May be simpler code:

      var df = spark.read
          .nebula(config, nebulaReadEdgeConfig)
          .loadEdgesToDF()
        if (weights.nonEmpty) {
          df = df.select("_srcId", "_dstId", weights(i))
        }

      dataset = dataset == null ? df:dataset.union(df)
  1. There may be wrong when hasWeight is false and weights is nonEmpty.
    Because there is not the weights(i) column in df.
    But There are right when it executes.
    Because It will fetch all props of edge when hasWeight is false.

  2. There will be java.lang.IndexOutOfBoundsException: 1 if the num of labels does not equal the num of weights.
    It's a just configuration error.

@Nicole00
Copy link
Contributor Author

3. if the num of labels does not equal the num of weights

  1. yeah, code will be unified.
  2. If hasWeight is false and weights is nonEmpty, the graph will has default 1.0 weight, means df has three columns and the third column has the same value 1.0. When hasWeight is false, the code will fetch no props of edge, because the config withNoColumn is true.
  3. good catch, will add config check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants