错误:“as_tible not exported by namespace arrow”和使用r的databricks上的apache arrow

jdgnovmf  于 2021-05-27  发布在  Spark
关注(0)|答案(0)|浏览(229)

我正在(azure)databricks上与r一起工作,并希望为i/o启用apachearrow。然而,使用下面的示例代码,我得到了一些我无法追溯的奇怪错误。
在使用databricks runtime ml7.0(spark 3.0.0)和ml7.1(spark 3.0.0)的集群上发生错误。

library(arrow)
library(dplyr)
library(SparkR)

arrow::arrow_available()

# TRUE

# initialize Spark session using Arrow

SparkR::sparkR.session(sparkConfig = list(spark.sql.execution.arrow.sparkr.enabled = "true"))

# create Spark DataFrame

df <- mtcars
spark_df <- cache(createDataFrame(df))

# write spark_df as parquet

sink_path <- "/dbfs/FileStore/testData"
file_path <- "dbfs:/FileStore/testData/arrow_testFile"
dir.create(sink_path , recursive=T, showWarnings=F)    
SparkR::write.parquet(spark_df, file_path, mode = "overwrite")

# read parquet file as Spark DataFrame and cache

file_path %>%
    SparkR::read.parquet() %>%
    SparkR::cache() -> sdf_new

# collect sdf_new

sdf_new %>%
    SparkR::collect() -> rdf_new

我收到的错误消息如下:

Error : 'as_tibble' is not an exported object from 'namespace:arrow'

我知道关于“as_tible”的一些变化还在继续,但对于我来说,我不清楚如何处理这个错误并使箭头飞起来。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题