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

    https://github.com/apache/spark/pull/17444#discussion_r108299910
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/BatchCommitLog.scala
 ---
    @@ -45,28 +45,37 @@ import org.apache.spark.sql.SparkSession
     class BatchCommitLog(sparkSession: SparkSession, path: String)
       extends HDFSMetadataLog[String](sparkSession, path) {
     
    +  import BatchCommitLog._
    +
    +  def add(batchId: Long): Unit = {
    +    super.add(batchId, SERIALIZED_VOID)
    +  }
    +
    +  override def add(batchId: Long, metadata: String): Boolean = {
    +    throw new UnsupportedOperationException(
    +      "BatchCommitLog does not take any metadata, use 'add(batchId)' 
instead")
    +  }
    +
       override protected def deserialize(in: InputStream): String = {
         // called inside a try-finally where the underlying stream is closed 
in the caller
         val lines = IOSource.fromInputStream(in, UTF_8.name()).getLines()
         if (!lines.hasNext) {
           throw new IllegalStateException("Incomplete log file in the offset 
commit log")
         }
    -    parseVersion(lines.next().trim, BatchCommitLog.VERSION)
    +    parseVersion(lines.next.trim, VERSION)
         // read metadata
    -    lines.next().trim match {
    -      case BatchCommitLog.SERIALIZED_VOID => null
    -      case metadata => metadata
    -    }
    +    val metadata = lines.next.trim
    +    assert(metadata == SERIALIZED_VOID, s"Batch commit log has unexpected 
metadata: $metadata ")
    --- End diff --
    
    What I tried to say is that if the message has some other fields in it, it 
shouldn't be fatal. We should probably log a warning saying that there may be 
bugs, upgrade your Spark version


---
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