Polars 2.0版本正式发布,为这个数据处理引擎引入了多项关键功能更新1。其中最重要的改进包括启用初始版本的磁盘溢出(spill-to-disk)支持、将流式引擎设为LazyFrame的collect()默认选项,以及将SQL提升为一级特性1。磁盘溢出功能在系统RAM达到约80%时自动启动,设置了64GB的磁盘预算上限1。
新版本还新增了Map数据类型,提供key查询、contains_key、keys()和values()等字典类方法的支持1。值得注意的是,流式引擎的默认启用对join、group_by、unpivot等操作无法保证行顺序的维持,用户需通过设置maintain_order=True来手动启用顺序保障1。同时,SQL功能范围显著扩展,优化器改进涵盖join重排、公共子计划消除和动态谓词/bloom过滤等优化策略1。
根据TPC-H和TPC-DS基准测试结果,Polars在性能上表现突出1。在c7a.4xlarge(16个虚拟CPU,32GB内存)和c7a.metal(192个虚拟CPU,384GB内存)两种配置下,Polars均超越DuckDB 1.5.6、DuckDB 2.0 alpha和DataFusion 54.0.01。当Polars限制到32核时,在所有基准测试中都具有竞争力或获胜1。从16个虚拟CPU扩展到192个虚拟CPU时,Polars的TPC-H性能提升3.8倍,TPC-DS性能提升2.2倍1。
Polars has unveiled version 2.0, introducing several significant capabilities that advance its data processing engine.1 The release enables an initial implementation of disk spill support, which automatically activates when RAM usage approaches approximately 80%, with a 64GB disk budget allocation.1 The streaming engine now operates as the default option for LazyFrame's collect() method, though certain operations including join, group_by, and unpivot do not guarantee row ordering unless explicitly enabled through maintain_order=True.1
Performance benchmarks demonstrate Polars' competitive positioning in the data processing landscape.1 Testing against DuckDB 1.5.6, DuckDB 2.0 alpha, and DataFusion 54.0.0 on both c7a.4xlarge instances (16 vCPUs, 32GB RAM) and c7a.metal configurations (192 vCPUs, 384GB RAM) shows Polars outperforming these alternatives across TPC-H and TPC-DS benchmarks.1 When limited to 32 cores, Polars maintains competitive or superior results across all benchmark tests.1 Performance scaling from 16 vCPUs to 192 vCPUs demonstrates a 3.8x improvement on TPC-H and a 2.2x improvement on TPC-DS.1
The release also introduces a new Map data type with dictionary-style functionality, supporting key queries, contains_key operations, and methods such as keys() and values().1 SQL support has expanded significantly with optimizer improvements including join reordering, common subplan elimination, and dynamic predicate and bloom filtering capabilities.1
评论
还没有评论,欢迎留下第一条。