Search code examples
databasesnowflake-cloud-data-platformdatabricksazure-databricks

Cannot read data - option() got an unexpected keyword argument 'sfUrl'


I'm trying to read data from snowflake database table into databricks. Below is my code:

options = {
 "sfUrl": "xxxxxx.snowflakecomputing.com",
 "sfUser": "xxxxxxx",
 "sfPassword": "xxxx",
 "sfDatabase": "xxxxxxx",
  "sfSchema": "xxxxxxx",
 "sfWarehouse": "xxxxxxxxx",
 "sfRole": "xxxxxxxx"
}

df = spark.read.format('snowflake').option(**options).option('query', 'select * from mytable').load()

I got the error like below:

TypeError: option() got an unexpected keyword argument 'sfUrl'

I followed the instruction onthis link. I do not understand why it failed. Does anyone know what went wrong?


Solution

  • Change sfUrl to sfURL and then test this operation.