pg_analytics

由 DuckDB 驱动的数据分析引擎

扩展总览

PIGSTY 第三方扩展: pg_analytics : 由 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依赖:无

最新版本

系统 架构 PG17 PG16 PG15 PG14 PG13
el8 x86_64 pg_analytics_17
PIGSTY 0.3.7
pg_analytics_16
PIGSTY 0.3.7
pg_analytics_15
PIGSTY 0.3.7
pg_analytics_14
PIGSTY 0.3.7
pg_analytics_13
PIGSTY 0.2.1
el8 aarch64 pg_analytics_17
PIGSTY 0.3.7
pg_analytics_16
PIGSTY 0.3.7
pg_analytics_15
PIGSTY 0.3.7
pg_analytics_14
PIGSTY 0.3.7
pg_analytics_13
PIGSTY 0.2.1
el9 x86_64 pg_analytics_17
PIGSTY 0.3.7
pg_analytics_16
PIGSTY 0.3.7
pg_analytics_15
PIGSTY 0.3.7
pg_analytics_14
PIGSTY 0.3.7
pg_analytics_13
PIGSTY 0.2.1
el9 aarch64 pg_analytics_17
PIGSTY 0.3.7
pg_analytics_16
PIGSTY 0.3.7
pg_analytics_15
PIGSTY 0.3.7
pg_analytics_14
PIGSTY 0.3.7
pg_analytics_13
PIGSTY 0.2.1
d12 x86_64 postgresql-17-pg-analytics
PIGSTY 0.3.7
postgresql-16-pg-analytics
PIGSTY 0.3.7
postgresql-15-pg-analytics
PIGSTY 0.3.7
postgresql-14-pg-analytics
PIGSTY 0.3.7
d12 aarch64 postgresql-17-pg-analytics
PIGSTY 0.3.7
postgresql-16-pg-analytics
PIGSTY 0.3.7
postgresql-15-pg-analytics
PIGSTY 0.3.7
postgresql-14-pg-analytics
PIGSTY 0.3.7
u22 x86_64 postgresql-17-pg-analytics
PIGSTY 0.3.7
postgresql-16-pg-analytics
PIGSTY 0.3.7
postgresql-15-pg-analytics
PIGSTY 0.3.7
postgresql-14-pg-analytics
PIGSTY 0.3.7
u22 aarch64 postgresql-17-pg-analytics
PIGSTY 0.3.7
postgresql-16-pg-analytics
PIGSTY 0.3.7
postgresql-15-pg-analytics
PIGSTY 0.3.7
postgresql-14-pg-analytics
PIGSTY 0.3.7
u24 x86_64 postgresql-17-pg-analytics
PIGSTY 0.3.7
postgresql-16-pg-analytics
PIGSTY 0.3.7
postgresql-15-pg-analytics
PIGSTY 0.3.7
postgresql-14-pg-analytics
PIGSTY 0.3.7
u24 aarch64 postgresql-17-pg-analytics
PIGSTY 0.3.7
postgresql-16-pg-analytics
PIGSTY 0.3.7
postgresql-15-pg-analytics
PIGSTY 0.3.7
postgresql-14-pg-analytics
PIGSTY 0.3.7

扩展安装

使用 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;




最后修改 2025-03-20: update extension version (52133a3)