cloud-fan commented on code in PR #48605:
URL: https://github.com/apache/spark/pull/48605#discussion_r1812318153
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/LogicalRelation.scala:
##########
@@ -102,3 +109,18 @@ object LogicalRelation {
LogicalRelation(relation, toAttributes(schema), Some(table), false)
}
}
+
+/**
+ * Extract the [[BaseRelation]] and [[CatalogTable]] from [[LogicalRelation]].
This also provides
+ * [[LogicalRelation]] itself, to cover the case where other params are needed
(but not required
+ * to have specific value to match).
+ */
+object RelationAndCatalogTable {
+ def unapply(plan: LogicalPlan): Option[(LogicalRelation, BaseRelation,
Option[CatalogTable])] = {
Review Comment:
```suggestion
def unapply(plan: LogicalRelation): Option[(BaseRelation,
Option[CatalogTable])] = {
```
How about this? Then the caller can be simplified `l @
RelationAndCatalogTable(fsRelation: HadoopFsRelation, _)`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]