Skip to content

Commit

Permalink
Remove unused statement variable (#205)
Browse files Browse the repository at this point in the history
* Remove unused statement variable

* Add ref to the task
  • Loading branch information
Shmuma authored Sep 15, 2023
1 parent fd5a879 commit c8a281d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
1 change: 1 addition & 0 deletions doc/changes/changes_2.1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Code name:

* 194: Wrong name of Exasol JDBC format in documentation
* 197: Committing transaction in the finally handler
* 198: Remove unused `Statement` variable

## Dependency Updates

Expand Down
10 changes: 0 additions & 10 deletions exasol-jdbc/src/main/scala/com/exasol/spark/rdd/ExasolRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class ExasolRDD(
override def compute(split: Partition, context: TaskContext): Iterator[Row] = {
var closed = false
var resultSet: ResultSet = null
val stmt: Statement = null
var conn: EXAConnection = null

def close(): Unit = {
Expand All @@ -110,14 +109,6 @@ class ExasolRDD(
case e: Exception => logWarning("Received an exception closing sub resultSet", e)
}

try {
if (stmt != null && !stmt.isClosed) {
stmt.close()
}
} catch {
case e: Exception => logWarning("Received an exception closing sub statement", e)
}

try {
if (conn != null) {
if (!conn.isClosed && !conn.getAutoCommit) {
Expand Down Expand Up @@ -156,5 +147,4 @@ class ExasolRDD(

JdbcUtils.resultSetToRows(resultSet, querySchema)
}

}

0 comments on commit c8a281d

Please sign in to comment.