mukul1409
Contributor II

The error happens because the function expects the table name to include both schema and table separated by a dot. Inside the function it splits the table name using a dot and tries to assign two values. When you pass only Economy, the split returns a single value and Python cannot unpack it, which causes the error. To fix this, pass the table name in schema and table format such as dbo.Economy. Another option is to update the function logic to handle table names without a schema by assigning a default schema when no dot is present. The issue is not related to Databricks or JDBC but to how the table name string is being processed.

Solution:


First option is to pass schema and table together when calling the function. For example use dbo.Economy or any valid schema name instead of just Economy.

Example call

Writer.jdbc_writer("dbo.Economy", economy, conf=CONF.MSSQL.to_dict(), modified_by=JOB_ID["Economy"])

Second option is to make the function more robust by handling table names without schema and assigning a default schema.

Example change inside jdbc_writer

if "." in table_name:
schema, table = table_name.split(".", 1)
else:
schema = "dbo"
table = table_name

This way the function will work whether you pass Economy or dbo.Economy.

The root cause is not related to Databricks or JDBC itself, it is purely a string split and unpacking issue in the function logic.

Mukul Chauhan