title: How to use EventHubsForeachWriter in Azure Databricks
body: <p>I'm trying to use EventHubsForeachWriter, as showed <a href="https://github.com/Azure/azure-event-hubs-spark/blob/1c198ba39a612afc08dca2646a1584570295ae1b/docs/structured-streaming-eventhubs-integration.md#foreachwriter" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code>val ehConf = EventHubsConf("YOUR_CONNECTION_STRING") 
  val writer = EventHubsForeachWriter(ehConf)
  
  val query =
    streamingSelectDF
      .writeStream
      .foreach(writer)
      .outputMode("update")
      .trigger(ProcessingTime("25 seconds"))
      .start()
  </code></pre>
  
  <p>but i'm getting an exception:</p>
  
  <pre><code>notebook:22: error: type mismatch;
   found   : org.apache.spark.sql.eventhubs.EventHubsForeachWriter
   required: org.apache.spark.sql.ForeachWriter[org.apache.spark.sql.Row]
      .foreach(writer)
  </code></pre>