cloud-fan commented on code in PR #50329: URL: https://github.com/apache/spark/pull/50329#discussion_r2004760884
########## sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/InMemoryTableCatalog.scala: ########## @@ -187,20 +187,22 @@ class InMemoryTableCatalog extends BasicInMemoryTableCatalog with SupportsNamesp new util.HashMap[Identifier, UnboundProcedure] procedures.put(Identifier.of(Array("dummy"), "increment"), UnboundIncrement) - protected def allNamespaces: Seq[Seq[String]] = { - (tables.keySet.asScala.map(_.namespace.toSeq) ++ namespaces.keySet.asScala).toSeq.distinct + protected def allNamespaces(): Seq[Seq[String]] = { + (tables.keySet.asScala.map(_.namespace.toSeq) + ++ namespaces.keySet.asScala + ++ procedures.keySet.asScala.map(_.namespace.toSeq)).toSeq.distinct } override def namespaceExists(namespace: Array[String]): Boolean = { - allNamespaces.exists(_.startsWith(namespace)) + allNamespaces().exists(_.startsWith(namespace)) } override def listNamespaces: Array[Array[String]] = { - allNamespaces.map(_.head).distinct.map(Array(_)).toArray + allNamespaces().map(_.head).distinct.map(Array(_)).toArray Review Comment: ```suggestion allNamespaces.map(_.head).distinct.map(Array(_)).toArray ``` ########## sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/InMemoryTableCatalog.scala: ########## @@ -187,20 +187,22 @@ class InMemoryTableCatalog extends BasicInMemoryTableCatalog with SupportsNamesp new util.HashMap[Identifier, UnboundProcedure] procedures.put(Identifier.of(Array("dummy"), "increment"), UnboundIncrement) - protected def allNamespaces: Seq[Seq[String]] = { - (tables.keySet.asScala.map(_.namespace.toSeq) ++ namespaces.keySet.asScala).toSeq.distinct + protected def allNamespaces(): Seq[Seq[String]] = { + (tables.keySet.asScala.map(_.namespace.toSeq) + ++ namespaces.keySet.asScala + ++ procedures.keySet.asScala.map(_.namespace.toSeq)).toSeq.distinct } override def namespaceExists(namespace: Array[String]): Boolean = { - allNamespaces.exists(_.startsWith(namespace)) + allNamespaces().exists(_.startsWith(namespace)) } override def listNamespaces: Array[Array[String]] = { - allNamespaces.map(_.head).distinct.map(Array(_)).toArray + allNamespaces().map(_.head).distinct.map(Array(_)).toArray } override def listNamespaces(namespace: Array[String]): Array[Array[String]] = { - allNamespaces + allNamespaces() Review Comment: ```suggestion allNamespaces ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org