Skip to content

Conversation

@cloud-fan
Copy link
Contributor

https://issues.apache.org/jira/browse/SPARK-10741
I choose the second approach: do not change output exprIds when convert MetastoreRelation to LogicalRelation

@cloud-fan
Copy link
Contributor Author

cc @yhuai

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to make it a case class because when a TreeNode makes copy, it copies parameters in its productIterator.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also manually implement product as is done here, but if possible I'd like to avoid that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we use the following?

private[sql] case class LogicalRelation(
    relation: BaseRelation,
    override val output: Seq[AttributeReference])
  extends LeafNode
  with MultiInstanceRelation {

  def this(relation: BaseRelation) = this(relation, relation.schema.toAttributes)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a discussion with @marmbrus and @cloud-fan, we will keep it as a case class and change other places where we need to use unapply. We will also pass in a Seq[AttributeReference] and do the work of adding the correct exprIds inside LogicalRelation.

@cloud-fan
Copy link
Contributor Author

cc @liancheng

@SparkQA
Copy link

SparkQA commented Sep 24, 2015

Test build #42934 has finished for PR 8889 at commit 798bc73.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Sep 24, 2015

Test build #42945 has finished for PR 8889 at commit 2e21513.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Sep 24, 2015

Test build #42962 has finished for PR 8889 at commit d317fb8.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a check to make sure that attrs and expectedOutputAttributes have the same length. Otherwise, zip will silently drop elements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, i see. You check the length at line 36.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then, let's add a comment to say where we check the length.

@SparkQA
Copy link

SparkQA commented Sep 24, 2015

Test build #42975 has finished for PR 8889 at commit 56efdc2.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yhuai
Copy link
Contributor

yhuai commented Sep 24, 2015

Seems it failed some tests.

@SparkQA
Copy link

SparkQA commented Sep 25, 2015

Test build #42986 has finished for PR 8889 at commit 30e930e.

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

@yhuai
Copy link
Contributor

yhuai commented Sep 25, 2015

@liancheng can you also take a look?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: seems that we don't use i here.

@liancheng
Copy link
Contributor

LGTM except for a few minor issues.

@SparkQA
Copy link

SparkQA commented Sep 26, 2015

Test build #43036 has finished for PR 8889 at commit 8fb386a.

  • This patch fails MiMa tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yhuai
Copy link
Contributor

yhuai commented Sep 27, 2015

test this please

@SparkQA
Copy link

SparkQA commented Sep 27, 2015

Test build #43053 has finished for PR 8889 at commit 8fb386a.

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

@yhuai
Copy link
Contributor

yhuai commented Sep 27, 2015

LGTM. Merging to master and branch 1.5.

asfgit pushed a commit that referenced this pull request Sep 27, 2015
…s not working

https://issues.apache.org/jira/browse/SPARK-10741
I choose the second approach: do not change output exprIds when convert MetastoreRelation to LogicalRelation

Author: Wenchen Fan <[email protected]>

Closes #8889 from cloud-fan/hot-bug.

(cherry picked from commit 418e5e4)
Signed-off-by: Yin Huai <[email protected]>
@asfgit asfgit closed this in 418e5e4 Sep 27, 2015
@cloud-fan cloud-fan deleted the hot-bug branch September 28, 2015 21:00
ashangit pushed a commit to ashangit/spark that referenced this pull request Oct 19, 2016
…s not working

https://issues.apache.org/jira/browse/SPARK-10741
I choose the second approach: do not change output exprIds when convert MetastoreRelation to LogicalRelation

Author: Wenchen Fan <[email protected]>

Closes apache#8889 from cloud-fan/hot-bug.

(cherry picked from commit 418e5e4)
Signed-off-by: Yin Huai <[email protected]>
(cherry picked from commit e0c3212)
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.

5 participants