Skip to content

Conversation

@srowen
Copy link
Member

@srowen srowen commented Jun 13, 2016

What changes were proposed in this pull request?

Another PR to clean up recent build warnings. This particularly cleans up several instances of the old accumulator API usage in tests that are straightforward to update. I think this qualifies as "minor".

How was this patch tested?

Jenkins

test("Normal accumulator should do boxing") {
// We need this test to make sure BoxingFinder works.
val l = sparkContext.accumulator(0L)
val f = () => { l += 1L }
Copy link
Member Author

Choose a reason for hiding this comment

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

This assertion is no longer true in the new LongAccumulator API

Copy link
Contributor

Choose a reason for hiding this comment

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

should we remove all the boxing test, include the BoxingFinder?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe... I am not sure what the purpose of the test was. The one that remains still passes.
BTW the old accumulator API is definitely still tested. I'm just changing tests that need an accumulator, not the old accumulator specifically. This avoids deprecation warnings.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then we should still keep this test, which is actually testing the BoxingFinder.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no boxing in the new implementation, since LongAccumulator exposes a method that accepts a primitive long now. Of course, I could change the test to manually box it. But then that seems like it's defeating whatever purpose I can imagine for the test. Is that really the right thing to do?

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm, since boxing is not a problem for the new accumulator anymore, maybe we can just remove all these tests? It's weird if we only remove one of them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, right now it's testing that a different, custom accumulator doesn't box. It doesn't, so it succeeds. You added the test so I think you're the authority here, and if you're OK removing the test, seems OK by me.

@SparkQA
Copy link

SparkQA commented Jun 13, 2016

Test build #60404 has finished for PR 13642 at commit c8850d1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SetAccumulator[T] extends AccumulatorV2[T, HashSet[T]]
    • case class ColumnMetrics()

@cloud-fan
Copy link
Contributor

maybe we should add a new test for old accumulators, to keep backward compatibility?

@SparkQA
Copy link

SparkQA commented Jun 14, 2016

Test build #60480 has finished for PR 13642 at commit 20c2a6b.

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

@asfgit asfgit closed this in 6151d26 Jun 14, 2016
@cloud-fan
Copy link
Contributor

thanks, merging to master!

@srowen , this PR conflicts with branch 2.0, can you send a new PR against 2.0? thanks!

asfgit pushed a commit that referenced this pull request Jun 14, 2016
…f old accumulators

Another PR to clean up recent build warnings. This particularly cleans up several instances of the old accumulator API usage in tests that are straightforward to update. I think this qualifies as "minor".

Jenkins

Author: Sean Owen <[email protected]>

Closes #13642 from srowen/BuildWarnings.

(cherry picked from commit 6151d26)
Signed-off-by: Sean Owen <[email protected]>
@srowen
Copy link
Member Author

srowen commented Jun 14, 2016

I just cherry-picked this commit to 2.0 and resolved conflicts.

@srowen srowen deleted the BuildWarnings branch June 16, 2016 21:05
class SQLMetricsSuite extends SparkFunSuite with SharedSQLContext {
import testImplicits._

test("SQLMetric should not box Long") {
Copy link
Member

Choose a reason for hiding this comment

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

Why remove this test? This test doesn't use the old accumulator API.

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 a problem anymore for new accumulator

Copy link
Member

Choose a reason for hiding this comment

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

@cloud-fan the test here is just making sure we won't bring boxing into SQLMetric in future.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that was my logic. This wouldn't happen without breaking the new API, so it didn't seem worth testing for. Or: there are a million things of that form we could test for but don't.

Copy link
Member

Choose a reason for hiding this comment

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

This wouldn't happen without breaking the new API,

Agreed. SQLMetric is not a public API, we may add new stuff. My point is that we don't need to delete a working test that does test some behavior we want to maintain. Anyway, this seems unlikely broken in future so I agree that not need to add it back.

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