读取 AWS Athena 中的 SQL,使用 Polars。

huangapple go评论57阅读模式
英文:

Read SQL from AWS Athena with Polars

问题

你可以使用polars从AWS Athena读取数据吗?之前我使用pandas:

import pandas as pd

pd.read_sql(SQL_STATMENT, conn)

我找到了这个用户指南:https://pola-rs.github.io/polars-book/user-guide/howcani/io/read_db.html
其中提到Athena目前还不支持。

英文:

I want to read from AWS Athena with polars. Is this possible? Before I used pandas:

import pandas as pd

pd.read_sql(SQL_STATMENT, conn)

I found this User Guide: https://pola-rs.github.io/polars-book/user-guide/howcani/io/read_db.html
where Athena is not yet supported.

答案1

得分: 3

好消息是你提供的文档并不包含所有受支持的数据库。

polars使用两个数据库连接库(或引擎):

  1. connectorx

  2. Apache Arrow adbc

坏消息是似乎都不支持Athena。暂时来说,你最好继续使用pandas来进行Athena查询,然后使用 pl.from_pandas(...)

英文:

The good news is that the doc that you linked isn't the full list of databases that are supported.

polars uses two database connection libraries (or engines):

  1. connectorx

  2. Apache Arrow adbc

The bad news is that neither of those seems to support Athena. For the time being your best bet is probably to continue to use pandas for athena queries and then use pl.from_pandas(...)

huangapple
  • 本文由 发表于 2023年4月19日 16:43:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76052454.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定