This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 75cb37011fa2 [SPARK-46325][CONNECT] Remove unnecessary override
functions when constructing `WrappedCloseableIterator` in
`ResponseValidator#wrapIterator`
75cb37011fa2 is described below
commit 75cb37011fa2a1cb00e633fac312eb15ab412df9
Author: yangjie01 <[email protected]>
AuthorDate: Fri Dec 8 14:00:28 2023 -0800
[SPARK-46325][CONNECT] Remove unnecessary override functions when
constructing `WrappedCloseableIterator` in `ResponseValidator#wrapIterator`
### What changes were proposed in this pull request?
This pr removes the overridden `hasNext` and `close` functions in the
construction of `WrappedCloseableIterator` in `ResponseValidator#wrapIterator`,
as these functions are identical to those defined in `WrappedCloseableIterator`.
- WrappedCloseableIterator
https://github.com/apache/spark/blob/9ffdcc398ed5560f34778d005da697f6ad0a15ee/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/CloseableIterator.scala#L30-L42
- ResponseValidator#wrapIterator
https://github.com/apache/spark/blob/9ffdcc398ed5560f34778d005da697f6ad0a15ee/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/ResponseValidator.scala#L62-L85
### Why are the changes needed?
Remove unnecessary override functions.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Pass GitHub Actions
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #44255 from LuciferYang/SPARK-46325.
Authored-by: yangjie01 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.../apache/spark/sql/connect/client/ResponseValidator.scala | 11 -----------
1 file changed, 11 deletions(-)
diff --git
a/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/ResponseValidator.scala
b/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/ResponseValidator.scala
index 2081196d4671..67f29c727ef4 100644
---
a/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/ResponseValidator.scala
+++
b/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/ResponseValidator.scala
@@ -65,22 +65,11 @@ class ResponseValidator extends Logging {
override def innerIterator: Iterator[T] = inner
- override def hasNext: Boolean = {
- innerIterator.hasNext
- }
-
override def next(): T = {
verifyResponse {
innerIterator.next()
}
}
-
- override def close(): Unit = {
- innerIterator match {
- case it: CloseableIterator[T] => it.close()
- case _ => // nothing
- }
- }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]