Skip to content

Commit

Permalink
Normalize table name casing in CopyBusinessCentral.ipynb (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertverbeek4PS authored Jan 13, 2025
2 parents 5a9f4e3 + ecac26e commit b7b7c48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fabric/CopyBusinessCentral.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b7b7c48

Please sign in to comment.