Skip to content

PARQUET-157: Divide by zero fix#102

Closed
jimfcarroll wants to merge 2 commits intoapache:masterfrom
jimfcarroll:divide-by-zero-fix
Closed

PARQUET-157: Divide by zero fix#102
jimfcarroll wants to merge 2 commits intoapache:masterfrom
jimfcarroll:divide-by-zero-fix

Conversation

@jimfcarroll
Copy link

There is a divide by zero error in logging code inside the InternalParquetRecordReader. I've been running with this fixed for a while but everytime I revert I hit the problem again. I can't believe anyone else hasn't had this problem. I submitted a Jira ticket a few weeks ago but didn't hear anything on the list so here's the fix.

This also avoids compiling log statements in some cases where it's unnecessary inside the checkRead method of InternalParquetRecordReader.

Also added a .gitignore entry to clean up a build artifact.

@jimfcarroll jimfcarroll changed the title Divide by zero fix PARQUET-157 Divide by zero fix Jan 19, 2015
@jimfcarroll jimfcarroll changed the title PARQUET-157 Divide by zero fix PARQUET-157: Divide by zero fix Jan 19, 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be logged if the total time processing and reading is 0ms? I think it would be better to do this:

if (totalTime > 0) {
  long percentReading = ...;
  long percentProcessing = ...;
  LOG.info("time spent so far"...);
}

Copy link
Author

Choose a reason for hiding this comment

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

I'll make that change.

I have a .gitignore change in a subsequent commit. Do you want that removed?

@rdblue
Copy link
Contributor

rdblue commented Jan 28, 2015

Just one comment and I'll commit this.

In the future, could you also explain any changes you include that aren't related to the fix? Wrapping the info messages in a check for Log.INFO makes sense, but an explanation would have helped. It looked like a big change for a divide-by-zero bug. Thanks!

Jim Carroll added 2 commits January 28, 2015 17:21
@jimfcarroll
Copy link
Author

Okay. I updated the PR so it incorporates your suggestion. It makes sense to me.

If you want me to pull the .gitignore commit, let me know.

@julienledem
Copy link
Member

+1 LGTM

@asfgit asfgit closed this in 32a9c6d Jan 30, 2015
@rdblue
Copy link
Contributor

rdblue commented Jan 30, 2015

Thanks @jimfcarroll!

@jimfcarroll
Copy link
Author

Thanks! I'm looking forward to 1.6.0.

dongche pushed a commit to dongche/incubator-parquet-mr that referenced this pull request Feb 3, 2015
There is a divide by zero error in logging code inside the InternalParquetRecordReader. I've been running with this fixed for a while but everytime I revert I hit the problem again. I can't believe anyone else hasn't had this problem. I submitted a Jira ticket a few weeks ago but didn't hear anything on the list so here's the fix.

This also avoids compiling log statements in some cases where it's unnecessary inside the checkRead method of InternalParquetRecordReader.

Also added a .gitignore entry to clean up a build artifact.

Author: Jim Carroll <[email protected]>

Closes apache#102 from jimfcarroll/divide-by-zero-fix and squashes the following commits:

423200c [Jim Carroll] Filter out parquet-scrooge build artifact from git.
22337f3 [Jim Carroll] PARQUET-157: Fix a divide by zero error when Parquet runs quickly. Also avoid compiling log statements in some cases where it's unnecessary.
rdblue pushed a commit to rdblue/parquet-mr that referenced this pull request Mar 9, 2015
There is a divide by zero error in logging code inside the InternalParquetRecordReader. I've been running with this fixed for a while but everytime I revert I hit the problem again. I can't believe anyone else hasn't had this problem. I submitted a Jira ticket a few weeks ago but didn't hear anything on the list so here's the fix.

This also avoids compiling log statements in some cases where it's unnecessary inside the checkRead method of InternalParquetRecordReader.

Also added a .gitignore entry to clean up a build artifact.

Author: Jim Carroll <[email protected]>

Closes apache#102 from jimfcarroll/divide-by-zero-fix and squashes the following commits:

423200c [Jim Carroll] Filter out parquet-scrooge build artifact from git.
22337f3 [Jim Carroll] PARQUET-157: Fix a divide by zero error when Parquet runs quickly. Also avoid compiling log statements in some cases where it's unnecessary.
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