sail 简单试用

sail 自身是自包含的,对于python包,同时提供了worker 以及server, 对于新版本sail 是需要独立安装spark conenct client

参考使用

  • 安装sail python
pip install "pysail==0.3.0"
  • 安装spark connect client

推荐新版本的

pip install "pyspark-client==4.0.0"
  • 启动本地connect server

可以通过python 启动,独立也是不错的选择

env RUST_LOG=debug sail spark server
  • 代码访问

一个简单的操作parquet文件的

from pyspark.sql import SparkSession

spark = SparkSession.builder.remote(f"sc://localhost:50051").getOrCreate()

df = spark.read.parquet("datas/*.parquet")
df.createOrReplaceTempView("users")

spark.sql("SELECT count(*) from users").show()
  • 效果

速度还是比较快的

说明

当前sail是有不少限制的(还在开发中),但是从性能上的确是很不错的,目前的catalog 只支持内存,实际上如果支持apache polaris,unity catalog 等就特别好了,当然湖仓格式也是比较重要的

参考资料

https://docs.lakesail.com/sail/latest/introduction/getting-started/

https://docs.lakesail.com/sail/latest/guide/sql/features.html

https://docs.lakesail.com/sail/latest/guide/dataframe/features.html

posted on 2025-07-02 08:00  荣锋亮  阅读(24)  评论(0)    收藏  举报

导航