diff --git a/fabric/CopyBusinessCentral.ipynb b/fabric/CopyBusinessCentral.ipynb index 4dfed10..d3b61ef 100644 --- a/fabric/CopyBusinessCentral.ipynb +++ b/fabric/CopyBusinessCentral.ipynb @@ -238,9 +238,9 @@ " df_new = df_new.withColumn(col_name, df_new[col_name].cast(col_type))\n", "\n", " #check if the table exists\n", - " if table_name in [t.name for t in spark.catalog.listTables()]: \n", + " if table_name.lower() in [t.name.lower() for t in spark.catalog.listTables()]:\n", " #read the old data into a new dataframe and union with the new dataframe\n", - " SQL_Query = \"SELECT * FROM \" + Lakehouse +\".\"+table_name; \n", + " SQL_Query = \"SELECT * FROM \" + Lakehouse +\".\"+table_name.lower(); \n", " #print(SQL_Query)\n", " df_old = spark.sql(SQL_Query)\n", " df_new = df_new.union(df_old).repartition(no_Partition)\n",