Skip to content

[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

Closed
wants to merge 3 commits into from

Conversation

seayi
Copy link
Contributor

@seayi seayi commented Jan 5, 2015

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

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
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@seayi
Copy link
Contributor Author

seayi commented Jan 5, 2015

i test with hive table,after modify the sameresult method it is ok

@seayi seayi changed the title Update HiveMetastoreCatalog.scala Update HiveMetastoreCatalog.scala(override the MetastoreRelation's sameresult method only compare databasename and table name) Jan 5, 2015
@marmbrus
Copy link
Contributor

marmbrus commented Jan 6, 2015

Can you also add a regression test to CachedTableSuite?

@marmbrus
Copy link
Contributor

marmbrus commented Jan 6, 2015

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];
Copy link
Contributor

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
}

Copy link
Contributor Author

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

@marmbrus
Copy link
Contributor

marmbrus commented Jan 6, 2015

Finally, please file a JIRA and add it to the PR title. Thanks!

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25091 has started for PR 3898 at commit 8d910aa.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25091 has finished for PR 3898 at commit 8d910aa.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25091/
Test PASSed.

@marmbrus
Copy link
Contributor

ping :)

@seayi
Copy link
Contributor Author

seayi commented Jan 11, 2015

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!

@SparkQA
Copy link

SparkQA commented Jan 11, 2015

Test build #25377 has started for PR 3898 at commit a277120.

  • This patch merges cleanly.

@seayi seayi changed the title Update HiveMetastoreCatalog.scala(override the MetastoreRelation's sameresult method only compare databasename and table name) [SPARK-5195][sql]Update HiveMetastoreCatalog.scala(override the MetastoreRelation's sameresult method only compare databasename and table name) Jan 11, 2015
@SparkQA
Copy link

SparkQA commented Jan 11, 2015

Test build #25378 has started for PR 3898 at commit 8f0c7d2.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 11, 2015

Test build #25377 has finished for PR 3898 at commit a277120.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25377/
Test PASSed.

@SparkQA
Copy link

SparkQA commented Jan 11, 2015

Test build #25378 has finished for PR 3898 at commit 8f0c7d2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25378/
Test PASSed.

asfgit pushed a commit that referenced this pull request Feb 3, 2015
…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 =>
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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

@marmbrus
Copy link
Contributor

marmbrus commented Feb 3, 2015

Thanks for fixing this! Merging to master.

@marmbrus
Copy link
Contributor

marmbrus commented Feb 3, 2015

Ahhh, I just noticed this was not made against master. Please make all PRs against master in the future.

@asfgit asfgit closed this in dca6faa Feb 3, 2015
kayousterhout pushed a commit to kayousterhout/spark-1 that referenced this pull request Feb 18, 2015
…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
asfgit pushed a commit that referenced this pull request Apr 2, 2015
…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
markhamstra pushed a commit to markhamstra/spark that referenced this pull request Apr 15, 2015
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants