title: Trouble when writing the data to Delta Lake in Azure databricks (Incompatible format detected)
body: <p>I need to read dataset into a DataFrame, then write the data to Delta Lake. But I have the following exception : </p>
  
  <pre><code>AnalysisException: 'Incompatible format detected.\n\nYou are trying to write to `dbfs:/user/class@azuredatabrickstraining.onmicrosoft.com/delta/customer-data/` using Databricks Delta, but there is no\ntransaction log present. Check the upstream job to make sure that it is writing\nusing format("delta") and that you are trying to write to the table base path.\n\nTo disable this check, SET spark.databricks.delta.formatCheck.enabled=false\nTo learn more about Delta, see https://docs.azuredatabricks.net/delta/index.html\n;
  </code></pre>
  
  <p>Here is the code preceding the exception :</p>
  
  <pre><code>from pyspark.sql.types import StructType, StructField, DoubleType, IntegerType, StringType
  
  inputSchema = StructType([
    StructField("InvoiceNo", IntegerType(), True),
    StructField("StockCode", StringType(), True),
    StructField("Description", StringType(), True),
    StructField("Quantity", IntegerType(), True),
    StructField("InvoiceDate", StringType(), True),
    StructField("UnitPrice", DoubleType(), True),
    StructField("CustomerID", IntegerType(), True),
    StructField("Country", StringType(), True)
  ])
  
  rawDataDF = (spark.read
    .option("header", "true")
    .schema(inputSchema)
    .csv(inputPath)
  )
  
  # write to Delta Lake
  rawDataDF.write.mode("overwrite").format("delta").partitionBy("Country").save(DataPath) 
  </code></pre>