如何从 R 中的 Presto 返回 64 位整数?

How to get a 64-bit integer back from Presto in R?

This article 描述了 R 中 64 位整数的状态。

This doc

R has no built-in type with lossless support for the full range of 64-bit or larger integers. Here, the following rules apply:

Values are returned as numeric

Conversion to character always returns a lossless decimal representation of the data

当我从具有 64 位整数的 Presto table 中获取结果时,结果是数字并且被破坏了。但是,当我用 as.character 转换它们时,结果是字符和损坏的。

您是否已从 Presto 中成功检索到 64 位整数?

您是否将 DBI 与 Presto JDBC driver 一起使用,还是有其他方法?

解决方法多于修复,您可以 "encourage" character 通过 casting 在 SQL 查询中:

select cast(field as varchar) as field, ...