如何以干净可读的格式显示 Sparklyr 表,类似于 Databricks 中 display() 的输出?

发布于 2025-01-14 21:33:19 字数 696 浏览 2 评论 0原文

Databricks 存在内置的 display() 函数(请参阅文档 此处)允许用户以干净且人类可读的方式显示 R 或 SparkR 数据帧,用户可以滚动查看所有列并对列进行排序。请参见下图:

在此处输入图像描述

有没有办法在 Databricks 中以这种方式显示从 Sparklyr 输出的表格?显然,我无法直接在 Sparklyr 表上使用函数,因此我尝试在使用 display() 函数之前将 Sparklyr 表转换为 R 数据帧,但遇到了 java.lang.IllegalArgumentException: Invalid type N 错误。

输入图片此处描述

There exist a Databricks’s built-in display() function (see documentation here) which allow users to display R or SparkR dataframe in a clean and human readable manner where user can scroll to see all the columns and perform sorting on the columns. See image below:

enter image description here

Is there a way to display tables that are output from sparklyr in such a manner in Databricks? Obviously I am not able to use function directly on the sparklyr table hence I attempted to convert the sparklyr table into a R dataframe before using display() function but was hit with java.lang.IllegalArgumentException: Invalid type N error.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文