What is difference between dataframe created using SparkR and dataframe created using Sparklyr?

可紊 提交于 2021-02-11 12:32:33

问题


I am reading a parquet file in Azure databricks: Using SparkR > read.parquet() Using Sparklyr > spark_read_parquet() Both the dataframes are different, Is there any way to convert SparkR dataframe into the sparklyr dataframe and vice-versa ?


回答1:


sparklyr creates tbl_spark. This is essentially just a lazy query written in Spark SQL. SparkR creates a SparkDataFrame which is more of a collection of data that is organized using a plan.

In the same way you can't use a tbl as a normal data.frame you can't use a tbl_spark the same way as a SparkDataFrame.

The only way I can think of to convert one to the other would be to write it to your data lake/ data warehouse or read it into r first.



来源:https://stackoverflow.com/questions/63464517/what-is-difference-between-dataframe-created-using-sparkr-and-dataframe-created

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!