简体   繁体   English

MonetDBe-Python 可以使用 COPY 命令吗?

[英]are COPY commands possible with MonetDBe-Python?

I was having some trouble bulk-loading records to go faster than what cursor.executemany would allow.我在将记录批量加载到 go 时遇到了一些麻烦,比cursor.executemany允许的速度更快。 I hoped the bulk operations documented with regular MonetDB here might work, so I tried an export as a test.我希望这里使用常规 MonetDB 记录的批量操作可能会起作用,所以我尝试导出作为测试。 eg cursor.execute("COPY SELECT * FROM foo INTO '/file/path.csv'") .例如cursor.execute("COPY SELECT * FROM foo INTO '/file/path.csv'") This doesn't raise an error unless the file already exists, but the resulting file is always 0 bytes.除非文件已经存在,否则不会引发错误,但生成的文件始终为 0 字节。 I tried the same with file STDOUT and it prints nothing.我对文件STDOUT进行了同样的尝试,但它什么也没打印。

Are these COPY commands meant to work on the embedded version?这些COPY命令是否适用于嵌入式版本?

Note: This is my first use of anything related to MonetDB.注意:这是我第一次使用与 MonetDB 相关的任何东西。 As a fan of SQLite and a not-super-impressed user of Amazon Redshift, this seemed like a neat project.作为 SQLite 的粉丝和对 Amazon Redshift 印象不深的用户,这似乎是一个不错的项目。 Not sure if MonetDB/e is the same as MonetDBLite - the former seems more active lately?不确定 MonetDB/e 是否与 MonetDBLite 相同 - 前者最近似乎更活跃?

Exporting data through a COPY INTO command should be possible in MonetDB/e, yes.在 MonetDB/e 中应该可以通过COPY INTO命令导出数据,是的。

However, this feature is not working currently.但是,此功能目前无法使用。 I was able to reproduce your problem, ie the COPY INTO creates the file where the data should be exported to, but doesn't write the data.我能够重现您的问题,即COPY INTO创建应将数据导出到的文件,但不写入数据。 This does not happen with regular MonetDB.常规 MonetDB 不会发生这种情况。

Our team is notified of this issue, and we're looking into it.我们的团队已收到此问题的通知,我们正在对其进行调查。 Thanks for the heads up!感谢您的提醒!

PS: Regarding your doubt about MonetDB/e vs MonetDBLite: our team no long develops and maintains MonetDBLite. PS:关于您对 MonetDB/e 与 MonetDBLite 的疑问:我们的团队不再开发和维护 MonetDBLite。 Both are embedded databases that use MonetDB as the core engine, but MonetDBLite is deprecated.两者都是使用 MonetDB 作为核心引擎的嵌入式数据库,但不推荐使用 MonetDBLite。 After having learnt some do's and don'ts with MonetDBLite, our team is developing our next generation of embedded databases.在了解了 MonetDBLite 的一些注意事项后,我们的团队正在开发我们的下一代嵌入式数据库。

So for your embedded database needs, you should follow what's coming out of our MonetDB/e projects.因此,对于您的嵌入式数据库需求,您应该关注我们的 MonetDB/e 项目的成果。

I've created a test for it at: https://github.com/MonetDBSolutions/monetdbe-examples/blob/CI/C/copy_into.c我在以下位置为它创建了一个测试: https://github.com/MonetDBSolutions/monetdbe-examples/blob/CI/C/copy_into.Z4A8A8A08F09D37B73795649038408B5F33Z

Also filed a bug report over on GitHub: https://github.com/MonetDB/MonetDB/issues/7058还提交了关于 GitHub 的错误报告: https://github.com/MonetDB/MonetDB/issues/7058

We're currently looking into this issue.我们目前正在调查这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM