You can handle VOID columns directly if you are on Databricks Runtime 18.2 or later for batch writes.
More details here
You can explicitly cast or replace VOID/NULL columns with appropriate types when reading from MongoDB
df = df.withColumn("files_col",
when(col("files_col").isNull(), lit(None).cast(StringType()))
.otherwise(col("files_col")))
VOID columns are not supported in streaming writes.
You can identify the MongoDB fields containing null/void values & create a mapping of column names to target Delta types (String etc). Then apply explicit casting using the code above & enable mergeSchema when writing to Delta for schema evolution. You can also use coalesce with default values for critical fields.
Always casting VOID columns to explicit types before writing to Delta regardless of runtime to ensure compatibility and avoid potential issues.