Skip to content

Conversation

@holdenk
Copy link
Contributor

@holdenk holdenk commented Jul 29, 2016

What changes were proposed in this pull request?

Avoid using postfix operation for command execution in SQLQuerySuite where it wasn't whitelisted and audit existing whitelistings removing postfix operators from most places. Some notable places where postfix operation remains is in the XML parsing & time units (seconds, millis, etc.) where it arguably can improve readability.

How was this patch tested?

Existing tests.

@srowen
Copy link
Member

srowen commented Jul 29, 2016

Oh, I thought the idea here was to un-whitelist most or all other occurrences. They're "whitelisted" just because they existed and were causing warnings, but most are probably not really good usages of postfix. At least I'd support a quick skim of the instances and undoing many usages of postfix.

@holdenk
Copy link
Contributor Author

holdenk commented Jul 29, 2016

I'm totally down with removing the others - I'll go through and remove the whitelisting in the places where it doesn't add much.

@holdenk
Copy link
Contributor Author

holdenk commented Jul 29, 2016

Did a first pass audit, leaving XML parsing alone for now.

@SparkQA
Copy link

SparkQA commented Jul 29, 2016

Test build #63021 has finished for PR 14407 at commit b264f2d.

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


killLeader()
delay(30 seconds)
delay(30.seconds)
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'd like to hear opinions on this. "30 seconds" seems like one of the more reasonable usages of postfix. Is it worth keeping, or trying to get rid of cases like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it might be reasonable to get rid of so that we can turn on the warnings to catch useful-ish things (like the "x isDefined")

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I prefer 30 seconds. I counted 3 non-time-related usages in your change, so this feels like a lot of churn for not much gain - we could just fix those and remove the unnecessary imports where postfix ops are not used.

It'd also help if it were possible to turn these warnings into errors, since people don't generally pay attention to warnings...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the consesus is we want to keep the time based postfix operators then we can definitetly narrow this down (unfortunatetly those files will remain whitelisted as a whole and won't trigger any warnings so we won't necessarily notice if people start using other postfix operators inside of them).

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 that's fine. Your patch shows that's really uncommon to begin with - most are caught during review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yah thats a good point we likely catch them during the codereview process so having the whitelisting probably isn't that bad. I'll switch this to leave the postfix time operators unless someone says otherwise over the weekend.

@SparkQA
Copy link

SparkQA commented Jul 29, 2016

Test build #63026 has finished for PR 14407 at commit 4dbd5fa.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 30, 2016

Test build #63029 has finished for PR 14407 at commit 91aabd2.

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

@SparkQA
Copy link

SparkQA commented Jul 30, 2016

Test build #63040 has finished for PR 14407 at commit df67cde.

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

@holdenk holdenk changed the title [SPARK-16779][TRIVIAL][WIP] Avoid using postfix operator for command execution in SQLQuerySuite [SPARK-16779][TRIVIAL] Avoid using postfix operator for command execution in SQLQuerySuite Jul 30, 2016
@holdenk holdenk changed the title [SPARK-16779][TRIVIAL] Avoid using postfix operator for command execution in SQLQuerySuite [SPARK-16779][TRIVIAL] Avoid using postfix operators where they do not add much and remove whitelisting Jul 30, 2016
@holdenk
Copy link
Contributor Author

holdenk commented Aug 8, 2016

Sounds like no objections on using postfix seconds operator - I'll go ahead and switch it to that.

@srowen
Copy link
Member

srowen commented Aug 8, 2016

LGTM

@SparkQA
Copy link

SparkQA commented Aug 8, 2016

Test build #63373 has finished for PR 14407 at commit e4d8452.

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

@vanzin
Copy link
Contributor

vanzin commented Aug 8, 2016

Merging to master.

@asfgit asfgit closed this in 9216901 Aug 8, 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.

4 participants