-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-5195][sql]Update HiveMetastoreCatalog.scala(override the MetastoreRelation's sameresult method only compare databasename and table name) #3898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
in previous : cache table t1; select count(*) from t1; it will read data from memory but the sql below will not,instead it read from hdfs: select count(*) from t1 t; because cache data is keyed by logical plan and compare with sameResult ,so when with alias the same table 's logicalplan is not the same logical plan so modify the sameresult method only compare databasename and table name
Can one of the admins verify this patch? |
i test with hive table,after modify the sameresult method it is ok |
Can you also add a regression test to |
ok to test |
@@ -427,6 +427,13 @@ private[hive] case class MetastoreRelation | |||
.getOrElse(sqlContext.defaultSizeInBytes)) | |||
} | |||
) | |||
override def sameResult(plan: LogicalPlan): Boolean = { | |||
val new_plan = plan.asInstanceOf[MetastoreRelation]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about when its not a metastore relation? how about:
plan match {
case mr: MetastoreRelation =>
mr.databaseName == databaseName && mr.tableName == tableName
case _ => false
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i will add thanks
Finally, please file a JIRA and add it to the PR title. Thanks! |
Test build #25091 has started for PR 3898 at commit
|
Test build #25091 has finished for PR 3898 at commit
|
Test PASSed. |
ping :) |
sorry i am busy these days i will file a JIRA and add it to the PR title and pull a new request as soon as possibly.:) thanks again for your advice and attention! |
Test build #25377 has started for PR 3898 at commit
|
Test build #25378 has started for PR 3898 at commit
|
Test build #25377 has finished for PR 3898 at commit
|
Test PASSed. |
Test build #25378 has finished for PR 3898 at commit
|
Test PASSed. |
…toreRelation's sameresult method only compare databasename and table name) override the MetastoreRelation's sameresult method only compare databasename and table name because in previous : cache table t1; select count(*) from t1; it will read data from memory but the sql below will not,instead it read from hdfs: select count(*) from t1 t; because cache data is keyed by logical plan and compare with sameResult ,so when table with alias the same table 's logicalplan is not the same logical plan with out alias so modify the sameresult method only compare databasename and table name Author: seayi <405078363@qq.com> Author: Michael Armbrust <michael@databricks.com> Closes #3898 from seayi/branch-1.2 and squashes the following commits: 8f0c7d2 [seayi] Update CachedTableSuite.scala a277120 [seayi] Update HiveMetastoreCatalog.scala 8d910aa [seayi] Update HiveMetastoreCatalog.scala
@@ -427,6 +427,13 @@ private[hive] case class MetastoreRelation | |||
.getOrElse(sqlContext.defaultSizeInBytes)) | |||
} | |||
) | |||
override def sameResult(plan: LogicalPlan): Boolean = { | |||
plan match { | |||
case mr: MetastoreRelation => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: 2 spaces for intents.
I'll fix while merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, marmbrus but i don't know how to make PRs against master,can you tell me? thanks again for your attension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you open the PR make sure the base branch says master
not branch-1.X
. https://help.github.com/articles/comparing-commits-across-time/#comparing-branches
Thanks for fixing this! Merging to master. |
Ahhh, I just noticed this was not made against master. Please make all PRs against master in the future. |
…toreRelation's sameresult method only compare databasename and table name) override the MetastoreRelation's sameresult method only compare databasename and table name because in previous : cache table t1; select count(*) from t1; it will read data from memory but the sql below will not,instead it read from hdfs: select count(*) from t1 t; because cache data is keyed by logical plan and compare with sameResult ,so when table with alias the same table 's logicalplan is not the same logical plan with out alias so modify the sameresult method only compare databasename and table name Author: seayi <405078363@qq.com> Author: Michael Armbrust <michael@databricks.com> Closes apache#3898 from seayi/branch-1.2 and squashes the following commits: 8f0c7d2 [seayi] Update CachedTableSuite.scala a277120 [seayi] Update HiveMetastoreCatalog.scala 8d910aa [seayi] Update HiveMetastoreCatalog.scala
…toreRelation's sameresult method only compare databasename and table name) override the MetastoreRelation's sameresult method only compare databasename and table name because in previous : cache table t1; select count(*) from t1; it will read data from memory but the sql below will not,instead it read from hdfs: select count(*) from t1 t; because cache data is keyed by logical plan and compare with sameResult ,so when table with alias the same table 's logicalplan is not the same logical plan with out alias so modify the sameresult method only compare databasename and table name Author: seayi <405078363@qq.com> Author: Michael Armbrust <michael@databricks.com> Closes #3898 from seayi/branch-1.2 and squashes the following commits: 8f0c7d2 [seayi] Update CachedTableSuite.scala a277120 [seayi] Update HiveMetastoreCatalog.scala 8d910aa [seayi] Update HiveMetastoreCatalog.scala
…toreRelation's sameresult method only compare databasename and table name) override the MetastoreRelation's sameresult method only compare databasename and table name because in previous : cache table t1; select count(*) from t1; it will read data from memory but the sql below will not,instead it read from hdfs: select count(*) from t1 t; because cache data is keyed by logical plan and compare with sameResult ,so when table with alias the same table 's logicalplan is not the same logical plan with out alias so modify the sameresult method only compare databasename and table name Author: seayi <405078363@qq.com> Author: Michael Armbrust <michael@databricks.com> Closes apache#3898 from seayi/branch-1.2 and squashes the following commits: 8f0c7d2 [seayi] Update CachedTableSuite.scala a277120 [seayi] Update HiveMetastoreCatalog.scala 8d910aa [seayi] Update HiveMetastoreCatalog.scala
override the MetastoreRelation's sameresult method only compare databasename and table name
because in previous :
cache table t1;
select count() from t1;
it will read data from memory but the sql below will not,instead it read from hdfs:
select count() from t1 t;
because cache data is keyed by logical plan and compare with sameResult ,so when table with alias the same table 's logicalplan is not the same logical plan with out alias so modify the sameresult method only compare databasename and table name