简体   繁体   English

问题(bug?)与MonetDB.R和dbWriteTable与csvdump = TRUE

[英]Issue (bug?) with MonetDB.R and dbWriteTable with csvdump=TRUE

We are managing to write 1.7 M rows in 30s or so (on a MacBook Pro) using R and MonetDB.R within a shiny application: 我们在一个闪亮的应用程序中使用R和MonetDB.R设法在30秒左右(在MacBook Pro上)写入1.7 M行:

dbWriteTable(conn, tableName, Dt,overwrite=TRUE, csvdump=TRUE)

As we understand the MonetDB.R code saves first in a /tmp folder the table in a csv format, then is loaded onto the MonetDB database with COPY INTO 据我们了解的MonetDB.R代码先保存在/tmp文件夹中的一个表csv格式,然后被装入MonetDB数据库COPY INTO

We have just tried on a centos server and RStudio Server and we got an access right error on the temporary folder in /tmp . 我们刚刚尝试过centos服务器和RStudio服务器,我们在/tmp的临时文件夹上遇到了访问权限错误。

We resolved the problem with the classic 我们用经典解决了这个问题

chmod -R 777 /tmp

But it seems we have to do it again if we run this part of the app within shiny hence it does not look a scalable solution. 但是,如果我们在应用程序中运行这部分内容,我们似乎必须再次这样做,因此它看起来不是一个可扩展的解决方案。

Would it be possible to get a more stable & scalable solution? 是否有可能获得更稳定和可扩展的解决方案?

(also, this feature was documented in MonetDB 0.94 but it does not appear anywhere in the 0.95 document on CRAN - can we safely assume that this is a typo and the feature is going to stay?) (此外,这个功能在MonetDB 0.94中有记录,但它没有出现在CRAN的0.95文档中的任何地方 - 我们能否安全地假设这是一个错字并且该功能将保留?)

MonetDB.R uses R's tempfile() to create the temporary CSV file. MonetDB.R使用R的tempfile()来创建临时CSV文件。 tempfile in turn calls tempdir to get a temporary directory. tempfile依次调用tempdir来获取临时目录。 You can control the location of this directory through the environment variable TMPDIR and others. 您可以通过环境变量TMPDIR和其他来控制此目录的位置。 See ?tempdir for details. 有关详细信息,请参阅?tempdir

eg 例如

$ TMPDIR=/tmp/foo R -e "print(tempfile())"
[1] "/tmp/bar/Rtmp7UKG0k/file1173e13a4477c"

$ TMPDIR=/tmp/bar R -e "print(tempfile())"
[1] "/tmp/foo/RtmpPxx76t/file1174a409c06a2"

With regards to your other question, the csvdump feature is going to remain, since MonetDB is quite fast at bulk CSV loading. 关于您的其他问题,csvdump功能将保留,因为MonetDB在批量CSV加载时非常快。

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

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