Github user brkyvz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17787#discussion_r113788603
  
    --- Diff: 
external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSinkSuite.scala
 ---
    @@ -108,6 +108,31 @@ class KafkaSinkSuite extends StreamTest with 
SharedSQLContext {
           s"save mode overwrite not allowed for kafka"))
       }
     
    +  test("batch - enforce analyzed plans SPARK-20496") {
    +    val df = Seq(1, 1).toDF("key").selectExpr("key", "2 as value")
    +    /* bad dataframe plan */
    +    val input = df.union(df)
    +    val topic = newTopic()
    +    testUtils.createTopic(topic)
    +
    +    /* No topic field or topic option */
    +    var writer: StreamingQuery = null
    +    var ex: Exception = null
    +    try {
    +      ex = intercept[AnalysisException] {
    +        writer = createKafkaWriter(input.toDF())(
    +          withSelectExpr = "value as key", "value"
    +        )
    +        writer.processAllAvailable()
    +      }
    +    } finally {
    +    }
    +    assert(ex.getMessage
    --- End diff --
    
    what is the error message when you undo your changes?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to