Github user adrian-wang commented on a diff in the pull request:
https://github.com/apache/spark/pull/3131#discussion_r19991505
--- 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 --
Since we may need some further modification in the TreeNode, I'd like to
separate that from this part and do that in `createPlanForView()`. I'm not
sure, we can discuss this further.
For case problem, Hive stores the table name with the original text without
turn it into lowercase. And I think it is not necessary to convert that here.
We can push this to reference resolving, as it already was there.
---
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]