⌘+k ctrl+k
1.4 (LTS)
搜索快捷键 cmd + k | ctrl + k
从 Apache Arrow 导入

CREATE TABLE ASINSERT INTO 可用于根据任何查询创建表。然后,我们可以通过在查询中引用 Apache Arrow 对象来创建表或插入现有表。此示例演示了如何从 Arrow Table 进行导入,但正如 SQL on Arrow 指南 中所述,DuckDB 也可以查询各种不同的 Apache Arrow 格式。

import duckdb
import pyarrow as pa

# connect to an in-memory database
my_arrow = pa.Table.from_pydict({'a': [42]})

# create the table "my_table" from the DataFrame "my_arrow"
duckdb.sql("CREATE TABLE my_table AS SELECT * FROM my_arrow")

# insert into the table "my_table" from the DataFrame "my_arrow"
duckdb.sql("INSERT INTO my_table SELECT * FROM my_arrow")
© 2025 DuckDB 基金会,阿姆斯特丹,荷兰
行为准则 商标使用指南