Skip to content
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

[SPARK-5486] Added validate method to BlockMatrix #4279

Closed
wants to merge 5 commits into from

Conversation

brkyvz
Copy link
Contributor

@brkyvz brkyvz commented Jan 29, 2015

The validate method will allow users to debug their BlockMatrix, if operations like add or multiply return unexpected results. It checks the following properties in a BlockMatrix:

  • Are the dimensions of the BlockMatrix consistent with what the user entered: (nRows, nCols)
  • Are the dimensions of each MatrixBlock consistent with what the user entered: (rowsPerBlock, colsPerBlock)
  • Are there blocks with duplicate indices

@SparkQA
Copy link

SparkQA commented Jan 30, 2015

Test build #26344 has finished for PR 4279 at commit 0aa519a.

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

@SparkQA
Copy link

SparkQA commented Jan 30, 2015

Test build #26372 has finished for PR 4279 at commit 25f083b.

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

@@ -172,6 +172,64 @@ class BlockMatrix(
assert(cols <= nCols, s"The number of columns $cols is more than claimed $nCols.")
}

def validate: Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

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

validate(), which is an action.

@SparkQA
Copy link

SparkQA commented Jan 30, 2015

Test build #26390 has finished for PR 4279 at commit 598c583.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • trait Star extends Attribute with trees.LeafNode[Expression]
    • case class UnresolvedStar(table: Option[String]) extends Star
    • case class ResolvedStar(expressions: Seq[NamedExpression]) extends Star

// Check if each MatrixBlock (except edges) has the dimensions rowsPerBlock x colsPerBlock
// The first tuple is the index and the second tuple is the dimensions of the MatrixBlock
blockInfo.foreach { case ((blockRowIndex, blockColIndex), (m, n)) =>
if (m != rowsPerBlock || n != colsPerBlock) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not correct. Checking m should be separate from checking n. m is valid if

(blockRowIndex < numRowBlocks - 1 && m == rowsPerBlock) || (blockRowIndex == numRowBlocks - 1 && m > 0 && m <= rowsPerBlock)

@SparkQA
Copy link

SparkQA commented Jan 30, 2015

Test build #26411 has finished for PR 4279 at commit c152a73.

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

@mengxr
Copy link
Contributor

mengxr commented Jan 30, 2015

LGTM. Merged into master. Thanks!

@asfgit asfgit closed this in 6ee8338 Jan 30, 2015
@brkyvz brkyvz deleted the SPARK-5486 branch February 3, 2019 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants