ravipesala commented on a change in pull request #3150: [CARBONDATA-3309] MV datamap supports Spark 2.1
URL:
https://github.com/apache/carbondata/pull/3150#discussion_r282766867
##########
File path: datamap/mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Logical2ModularExtractions.scala
##########
@@ -333,23 +332,6 @@ object ExtractTableModule extends PredicateHelper {
type ReturnType = (String, String, Seq[NamedExpression], Seq[LogicalPlan], FlagSet, Seq[Seq[Any]])
def unapply(plan: LogicalPlan): Option[ReturnType] = {
- plan match {
- // uncomment for cloudera1 version
-// case m: CatalogRelation =>
-// Some(m.tableMeta.database, m.tableMeta.identifier.table, m.output, Nil, NoFlags,
-// Seq.empty)
-// uncomment for apache version
- case m: HiveTableRelation =>
- Some(m.tableMeta.database, m.tableMeta.identifier.table, m.output, Nil, NoFlags,
- Seq.empty)
- case l: LogicalRelation =>
- val tableIdentifier = l.catalogTable.map(_.identifier)
- val database = tableIdentifier.map(_.database).flatten.getOrElse(null)
- val table = tableIdentifier.map(_.table).getOrElse(null)
- Some(database, table, l.output, Nil, NoFlags, Seq.empty)
- case l: LocalRelation => // used for unit test
- Some(null, null, l.output, Nil, NoFlags, Seq.empty)
- case _ => None
Review comment:
No need to create a separate class and duplicate the code here just for ` CatalogRelation`. Just check the class name and extract the necessary information from it like we have done it in `CarbonFileMetastore#lookupRelation`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services