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

HPCC 30381 Parquet plugin function names and member variables should be more consistent. #18024

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

jackdelv
Copy link
Contributor

@jackdelv jackdelv commented Nov 13, 2023

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

@jackdelv jackdelv requested a review from dcamper November 13, 2023 20:12
Copy link
Contributor

@dcamper dcamper left a comment

Choose a reason for hiding this comment

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

A few minor changes, all in comments. Looks good!

*
* @param option The read or write option as well as information about partitioning.
* @param _location The location to read a parquet file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it read, "The full path from which to read a Parquet file"?

Additionally: Recommend capitalizing "Parquet" in all comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Capitalized Parquet and reworded to clarify it is a full path to the target.

*
* @param option The read or write option as well as information about partitioning.
* @param _location The location to read a parquet file.
* @param _batchSize The size of the batches when converting parquet columns to rows.
Copy link
Contributor

Choose a reason for hiding this comment

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

What scale is this? Bytes? Megabytes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

batchSize is the number of rows in the RecordBatch. Changed comment to be more descriptive.

}

/**
* @brief Contructs a ParquetWriter for the target location and checks for existing data.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: 'Contructs'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

* @brief Contructs a ParquetWriter for the target location and checks for existing data.
*
* @param option The read or write option as well as information about partitioning.
* @param _destination The destination to write a parquet file.
Copy link
Contributor

Choose a reason for hiding this comment

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

That is a full path, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to specify this is the full path.

*
* @param option The read or write option as well as information about partitioning.
* @param _destination The destination to write a parquet file.
* @param _rowSize The max row group size when creating RecordBatches for output.
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the scale? Bytes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworded to clarify that rowSize is the maximum number of rows in a RecordBatch.

Copy link
Contributor

@dcamper dcamper Nov 14, 2023

Choose a reason for hiding this comment

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

May I suggest _maxRowCountInBatch or something along those lines as a variable name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to maxRowCountInBatch. That is much more readable and causes less confusion.

}

std::unordered_map<std::string, std::shared_ptr<arrow::Array>> &ParquetHelper::next()
/**
* @brief convert a vector of rapidjson::Documents containing single rows to an arrow::RecordBatch
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Capital 'convert'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

__int64 rowSize = 40000; // Size of the row groups when writing to parquet files
__int64 batchSize = 40000; // Size of the batches when converting parquet columns to rows
bool overwrite = false; // If true overwrite file with no error. The default is false and will throw an error if the file already exists.
arrow::Compression::type compressionOption = arrow::Compression::UNCOMPRESSED; // Compression option that supports all arrow compression types.
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment is a bit confusing. I think it is referring to 'what is compressionOption' but it somehow makes me think it is describing arrow::Compression::UNCOMPRESSED

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworded description of compressionOption.

@jackdelv jackdelv requested a review from dcamper November 28, 2023 15:01
Copy link
Contributor

@dcamper dcamper left a comment

Choose a reason for hiding this comment

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

A few very minor changes. Looking really good!

*
* @param option The read or write option as well as information about partitioning.
* @param _destination The destination to write a parquet file.
* @param _rowSize The max row group size when creating RecordBatches for output.
* @param _destination The full path for which to write a Parquet file or partitioned dataset.
Copy link
Contributor

Choose a reason for hiding this comment

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

Trivial: 'full path for which' -> 'full path to which'

Also: If the path can represent either a file or a directory, depending on the Parquet file type, then you might want to note that. (virtually copy this comment to other 'path' documentation lines).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added better descriptions to location and destination comments.

plugins/parquet/parquetembed.cpp Show resolved Hide resolved
plugins/parquet/parquetembed.cpp Show resolved Hide resolved
@jackdelv jackdelv requested a review from dcamper November 28, 2023 18:13
Copy link
Contributor

@dcamper dcamper left a comment

Choose a reason for hiding this comment

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

Looks good! Please squash.

@jackdelv
Copy link
Contributor Author

@dcamper Squashed.

@jackdelv
Copy link
Contributor Author

@ghalliday This is ready to merge.

@ghalliday ghalliday merged commit 8c6bfc2 into hpcc-systems:candidate-9.4.x Nov 29, 2023
47 checks passed
@ghalliday
Copy link
Member

@jackdelv I should have checked. For the future, the format of the commit should be "HPCC-NNNN" rather than "HPCC NNNN".

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