pg_analytics
由 DuckDB 驱动的数据分析引擎
Module:
Categories:
扩展总览
PIGSTY 第三方扩展: pg_analytics
: 由 DuckDB 驱动的数据分析引擎
基本信息
- 扩展编号: 2420
- 扩展名称:
pg_analytics
- 标准包名:
pg_analytics
- 扩展类目:
OLAP
- 开源协议: PostgreSQL
- 官方网站: https://github.com/paradedb/pg_analytics
- 编程语言: Rust
- 其他标签:
pgrx
,duckdb
- 备注信息: 无
元数据
- 默认版本: 0.3.7
- PG大版本:
17
,16
,15
,14
- 动态加载: 无需动态加载
- 需要DDL: 需要执行
CREATE EXTENSION
DDL - 可重定位: 可以重定位安装至其他模式下
- 信任程度: 受信任,无需超级用户,带
CREATE
权限的用户可以直接创建 - 所需模式:
paradedb
- 所需扩展: 无
软件包
- RPM仓库:PIGSTY
- RPM包名:
pg_analytics_$v
- RPM版本:
0.3.4
- RPM依赖:无
- DEB仓库:PIGSTY
- DEB包名:
postgresql-$v-pg-analytics
- DEB版本:
0.3.3
- DEB依赖:无
最新版本
扩展安装
使用 pig
命令行工具安装 pg_analytics
扩展:
pig ext install pg_analytics
使用 Pigsty剧本 安装 pg_analytics 扩展:
./pgsql.yml -t pg_extension -e '{"pg_extensions": ["pg_analytics"]}' # -l <集群名>
从 YUM仓库 手工安装 pg_analytics
RPM 包:
dnf install pg_analytics_17;
dnf install pg_analytics_16;
dnf install pg_analytics_15;
dnf install pg_analytics_14;
从 APT仓库 手工安装 pg_analytics
DEB 包:
apt install postgresql-17-pg-analytics;
apt install postgresql-16-pg-analytics;
apt install postgresql-15-pg-analytics;
apt install postgresql-14-pg-analytics;
使用以下 SQL 命令在已经安装此扩展插件的 PG 集群上 启用 pg_analytics
扩展:
CREATE EXTENSION pg_analytics;
使用方法
https://github.com/paradedb/pg_analytics
Example, read parquet file from S3:
CREATE EXTENSION pg_lakehouse;
CREATE FOREIGN DATA WRAPPER parquet_wrapper HANDLER parquet_fdw_handler VALIDATOR parquet_fdw_validator;
-- Provide S3 credentials
CREATE SERVER parquet_server FOREIGN DATA WRAPPER parquet_wrapper;
-- Create foreign table with auto schema creation
CREATE FOREIGN TABLE trips ()
SERVER parquet_server
OPTIONS (files 's3://paradedb-benchmarks/yellow_tripdata_2024-01.parquet');
-- Success! Now you can query the remote Parquet file like a regular Postgres table
SELECT COUNT(*) FROM trips;
count
---------
2964624
(1 row)
This fdw is read-only for now.
Iceberg Support
CREATE EXTENSION pg_lakehouse;
CREATE FOREIGN DATA WRAPPER iceberg_wrapper
HANDLER iceberg_fdw_handler
VALIDATOR iceberg_fdw_validator;
CREATE SERVER iceberg_server
FOREIGN DATA WRAPPER iceberg_wrapper;
-- Replace the dummy schema with the actual schema
CREATE FOREIGN TABLE iceberg_table (x INT)
SERVER iceberg_server
OPTIONS (files 's3://bucket/iceberg_folder');
-- Success! You can now query the Iceberg table
SELECT COUNT(*) FROM iceberg_table;