Skip to content

Conversation

@mpjlu
Copy link

@mpjlu mpjlu commented Aug 26, 2016

What changes were proposed in this pull request?

The require condition and message doesn't match, and the condition also should be optimized.
Small change. Please kindly let me know if JIRA required.

How was this patch tested?

No additional test required.

@SparkQA
Copy link

SparkQA commented Aug 26, 2016

Test build #64463 has finished for PR 14824 at commit e5af18f.

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

require(colPtrs.length == numCols + 1 || colPtrs.length == numRows + 1, "The length of the " +
"column indices should be the number of columns + 1. Currently, colPointers.length: " +
s"${colPtrs.length}, numCols: $numCols")
require(!isTransposed && colPtrs.length == numCols + 1 ||
Copy link
Member

Choose a reason for hiding this comment

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

This may be clearer if you just have two clauses:

if (isTransposed) {
  require(...)
} else {
  require(...)
}

That lets you write a shorter specific message in both cases.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @srowen , code is updated.

"column indices should be the number of columns + 1. Currently, colPointers.length: " +
s"${colPtrs.length}, numCols: $numCols")
if (isTransposed) {
require(colPtrs.length == numRows + 1, "The length of the column indices should be " +
Copy link
Member

Choose a reason for hiding this comment

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

I think our style would be to indent subsequent lines in a continuation. You might just simplify these messages to something like

require(...,
   s"Expecting ${numRows + 1} colPtrs when numRows = $numRows but got ${colPtrs.length}")

Copy link
Author

Choose a reason for hiding this comment

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

Updated, thanks @srowen

@SparkQA
Copy link

SparkQA commented Aug 26, 2016

Test build #64480 has finished for PR 14824 at commit ea0aa9c.

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

@SparkQA
Copy link

SparkQA commented Aug 26, 2016

Test build #64481 has finished for PR 14824 at commit 3b756ec.

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

@SparkQA
Copy link

SparkQA commented Aug 26, 2016

Test build #64483 has finished for PR 14824 at commit c8b817f.

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

@SparkQA
Copy link

SparkQA commented Aug 26, 2016

Test build #64484 has finished for PR 14824 at commit dfded28.

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

asfgit pushed a commit that referenced this pull request Aug 27, 2016
…Matrix.

## What changes were proposed in this pull request?
The require condition and message doesn't match, and the condition also should be optimized.
Small change.  Please kindly let me know if JIRA required.

## How was this patch tested?
No additional test required.

Author: Peng, Meng <peng.meng@intel.com>

Closes #14824 from mpjlu/smallChangeForMatrixRequire.

(cherry picked from commit 40168db)
Signed-off-by: Sean Owen <sowen@cloudera.com>
@srowen
Copy link
Member

srowen commented Aug 27, 2016

Merged to master/2.0

@asfgit asfgit closed this in 40168db Aug 27, 2016
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.

3 participants