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

    https://github.com/apache/spark/pull/8116#discussion_r36822766
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeRowSerializerSuite.scala
 ---
    @@ -25,6 +25,18 @@ import 
org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow}
     import org.apache.spark.sql.catalyst.expressions.{UnsafeProjection, 
UnsafeRow}
     import org.apache.spark.sql.types._
     
    +
    +/**
    + * used to test close InputStream in UnsafeRowSerializer
    + */
    +class ClosableByteArrayInputStream(buf: Array[Byte]) extends 
ByteArrayInputStream(buf) {
    --- End diff --
    
    If you want to do this in a less-clear, more confusing way, you could use 
Mockito to `spy` a regular `ByteArrayInuptStream` then use Mockito assertions 
to check that `close()` was called. This is probably clearer, though, so no 
reason to resort to a complicated approach.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to