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

feat: writer nebulagraph_edge sink support #8

Merged
merged 1 commit into from
Aug 20, 2024
Merged

feat: writer nebulagraph_edge sink support #8

merged 1 commit into from
Aug 20, 2024

Conversation

wey-gu
Copy link
Owner

@wey-gu wey-gu commented Aug 20, 2024

close: #6

from ng_nx import NebulaWriter

edge_data = [
    ("player1", "player2", 0, [2022, 2023]),  # src, dst, rank, [start_year, end_year]
    ("player2", "player3", 1, [2021, 2022]),
    # ... more edges ...
]

edge_writer = NebulaWriter(data=edge_data, nebula_config=config)

properties = ["start_year", "end_year"]

edge_writer.set_options(
    label="follow",  # Edge type name
    properties=properties,
    batch_size=256,
    write_mode="insert",
    sink="nebulagraph_edge",
)

edge_writer.write()

```python
from ng_nx import NebulaWriter

edge_data = [
    ("player1", "player2", 0, [2022, 2023]),  # src, dst, rank, [start_year, end_year]
    ("player2", "player3", 1, [2021, 2022]),
    # ... more edges ...
]

edge_writer = NebulaWriter(data=edge_data, nebula_config=config)

properties = ["start_year", "end_year"]

edge_writer.set_options(
    label="follow",  # Edge type name
    properties=properties,
    batch_size=256,
    write_mode="insert",
    sink="nebulagraph_edge",
)

edge_writer.write()
```
@wey-gu wey-gu merged commit 6e61810 into main Aug 20, 2024
@wey-gu wey-gu deleted the dev branch August 20, 2024 11:20
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.

feat: nebulagraph_edge sink support for writer
1 participant