如何从突触中的数据库加载 table 到默认值(spark)?

How to load a table from a databse in synapse to default(spark)?

我正在尝试将 table 加载到数据库中的 table 数据库中的 synapse azure 到默认值(spark),这样我就可以调用 table 到 运行 各自的 pandas 代码。但是我做不到。

%%spark
val df = spark.read.sqlanalytics("emea***********.rpt.Vw_APInvoices") 
df.write.mode("overwrite").saveAsTable("default.t1")

错误:

Error : com.microsoft.spark.sqlanalytics.exception.SQLAnalyticsConnectorException: The specified table does not exist. Please provide a valid table.
  at com.microsoft.spark.sqlanalytics.read.SQLAnalyticsReader.readSchema(SQLAnalyticsReader.scala:103)
  at org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation$.create(DataSourceV2Relation.scala:175)
  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:204)
  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:167)
  at org.apache.spark.sql.SqlAnalyticsConnector$SQLAnalyticsFormatReader.sqlanalytics(SqlAnalyticsConnector.scala:42)
  ... 52 elided

The error message clearly says - The specified table does not exist. Please provide a valid table.

Error : com.microsoft.spark.sqlanalytics.exception.SQLAnalyticsConnectorException: The specified table does not exist. Please provide a valid table.

Make sure specified table exists before you running above code.

参考: Azure Synapse Analytics - Load the NYC Taxi data into the Spark nyctaxi database.