DuckPGQ – 用于图计算工作负载的 DuckDB 社区扩展
DuckPGQ – A DuckDB community extension for graph workloads

原始链接: https://duckpgq.org/

DuckPGQ 是 DuckDB 的一个开源社区扩展,旨在为您现有的工作流程引入高性能、基于 SQL 的图分析功能。它遵循 SQL:2023 标准,支持在 DuckDB 中直接进行原生图模式匹配,无需额外的依赖项。 DuckPGQ 专为无缝集成而设计,允许用户从现有表格定义属性图,并使用直观的 SQL 语法执行复杂查询,例如最短路径、共同连接以及多关系遍历。该扩展功能广泛,在社交网络、航空物流和金融分析(如欺诈检测或贷款风险评估)等多个领域都有实际应用。 其安装过程简单直接,仅需使用标准的 `INSTALL` 和 `LOAD` 命令即可。尽管 DuckPGQ 目前仍是一个基于研究的项目且处于开发阶段,但对于那些希望弥合关系型数据与图分析洞察之间差距的用户来说,它提供了一个强大且可扩展的解决方案。社区积极鼓励用户试用该工具并提供反馈,以支持其持续开发。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 DuckPGQ – 用于图工作负载的 DuckDB 社区扩展 (duckpgq.org) 由 rzk 在 1 小时前发布,5 分 | 隐藏 | 过往 | 收藏 | 讨论 | 帮助 考虑申请 YC 2026 年秋季批次!申请截止日期为 7 月 27 日。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

DuckPGQ is a DuckDB community extension for graph workloads that supports the SQL/PGQ standard.

Leveraging the power of DuckDB to bring high-performance, SQL-based graph query capabilities directly to your analytical workflows.

Install and Load DuckPGQ

Key Features

  • SQL/PGQ Standard
    Supports graph pattern matching with SQL/PGQ, following the SQL:2023 standard.
  • High Performance
    Leverages DuckDB for efficient, in-process graph analytics.
  • Easy To Install
    Seamlessly integrate with DuckDB through a simple setup process, requiring no dependencies.
  • Open Source
    Community-driven, extensible, and free to use.

Explore DuckPGQ Across Domains

Setup
Setup
ATTACH 'https://github.com/Dtenwolde/duckpgq-docs/raw/refs/heads/main/datasets/finbench.duckdb' AS finbench;
use finbench;
INSTALL duckpgq FROM community;
LOAD duckpgq; 

CREATE OR REPLACE PROPERTY GRAPH finbench
VERTEX TABLES (
  Account, Company, Loan, 
  Medium, Person
)
EDGE TABLES (
  AccountRepayLoan        SOURCE KEY (accountId) REFERENCES Account (accountId)
                          DESTINATION KEY (loanId) REFERENCES Loan (loanId) 
                          LABEL repay,
  AccountTransferAccount  SOURCE KEY (fromId) REFERENCES Account (accountId)
                          DESTINATION KEY (toId) REFERENCES Account (AccountId) 
                          LABEL transfer,
  AccountWithdrawAccount  SOURCE KEY (fromId) REFERENCES Account (accountId)
                          DESTINATION KEY (toId) REFERENCES Account (AccountId) 
                          LABEL withdraw,
  CompanyApplyLoan        SOURCE KEY (companyId) REFERENCES Company (companyId)
                          DESTINATION KEY (loanId) REFERENCES Loan (loanId) 
                          LABEL companyApply,
  CompanyGuaranteeCompany SOURCE KEY (fromId) REFERENCES Company (companyId)
                          DESTINATION KEY (toId) REFERENCES Company (companyId) 
                          LABEL companyGuarantee,
  CompanyInvestCompany    SOURCE KEY (investorId) REFERENCES Company (companyId)
                          DESTINATION KEY (companyId) REFERENCES Company (companyId) 
                          LABEL companyInvest,
  CompanyOwnAccount       SOURCE KEY (companyId) REFERENCES Company (companyId)
                          DESTINATION KEY (accountId) REFERENCES Account (accountId) 
                          LABEL companyOwn,
  LoanDepositAccount      SOURCE KEY (loanId) REFERENCES Loan (loanId)
                          DESTINATION KEY (accountId) REFERENCES Account (accountId) 
                          LABEL deposit,
  MediumSignInAccount     SOURCE KEY (mediumId) REFERENCES Medium (mediumId)
                          DESTINATION KEY (accountId) REFERENCES Account (accountId) 
                          LABEL signIn,
  PersonApplyLoan         SOURCE KEY (personId) REFERENCES Person (personId)
                          DESTINATION KEY (loanId) REFERENCES Loan (loanId) 
                          LABEL personApply,
  PersonGuaranteePerson   SOURCE KEY (fromId) REFERENCES Person (personId)
                          DESTINATION KEY (toId) REFERENCES Person (personId) 
                          LABEL personGuarantee,
  PersonInvestCompany     SOURCE KEY (investorId) REFERENCES Person (personId)
                          DESTINATION KEY (companyId) REFERENCES Company (companyId) 
                          LABEL personInvest,
  PersonOwnAccount        SOURCE KEY (personId) REFERENCES Person (personId)
                          DESTINATION KEY (accountId) REFERENCES Account (accountId) 
                          LABEL personOwn
);

WIP Disclaimer

DuckPGQ is currently a research project and still a work in progress. While we encourage you to explore and experiment with it, please be aware that there may be bugs, incomplete features, or unexpected behaviour.

We greatly appreciate any feedback or bug reports that help us improve and evolve the extension. Feel free to share your experiences!

联系我们 contact @ memedata.com