Skip to content

Commit 51e69fe

Browse files
committed
[SPARK-29851][SQL][FOLLOW-UP] Use foreach instead of misusing map
### What changes were proposed in this pull request? This PR proposes to use foreach instead of misusing map as a small followup of #26476. This could cause some weird errors potentially and it's not a good practice anyway. See also SPARK-16694 ### Why are the changes needed? To avoid potential issues like SPARK-16694 ### Does this PR introduce any user-facing change? No ### How was this patch tested? Existing tests should cover. Closes #26729 from HyukjinKwon/SPARK-29851. Authored-by: HyukjinKwon <[email protected]> Signed-off-by: HyukjinKwon <[email protected]>
1 parent d1465a1 commit 51e69fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/catalyst/src/test/scala/org/apache/spark/sql/connector/InMemoryTableCatalog.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ class InMemoryTableCatalog extends BasicInMemoryTableCatalog with SupportsNamesp
180180
}
181181

182182
override def dropNamespace(namespace: Array[String]): Boolean = {
183-
listNamespaces(namespace).map(dropNamespace)
184-
listTables(namespace).map(dropTable)
183+
listNamespaces(namespace).foreach(dropNamespace)
184+
listTables(namespace).foreach(dropTable)
185185
Option(namespaces.remove(namespace.toList)).isDefined
186186
}
187187
}

0 commit comments

Comments
 (0)