Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/3131#discussion_r19989764
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala ---
@@ -68,19 +66,25 @@ private[hive] class HiveMetastoreCatalog(hive:
HiveContext) extends Catalog with
tableName: String,
alias: Option[String]): LogicalPlan = synchronized {
val (databaseName, tblName) = processDatabaseAndTableName(
-
db.getOrElse(hive.sessionState.getCurrentDatabase), tableName)
+ db.getOrElse(hive.sessionState.getCurrentDatabase), tableName)
val table = client.getTable(databaseName, tblName)
- val partitions: Seq[Partition] =
- if (table.isPartitioned) {
- HiveShim.getAllPartitionsOf(client, table).toSeq
- } else {
- Nil
- }
+ if (table.isView) {
+ // if the unresolved relation is from hive view
+ // parse the text into logic node.
+ HiveQl.createPlanForView(table, alias)
--- End diff --
I am wondering if we can just call the `HiveQl.createPlan()` directly here,
since `alias` is not part of the `view`, and also, we may need to normalize the
name of `view` or `alias`. Like below, `// Since HiveQL is case insensitive for
table names we make them all lowercase.`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]