Skip to content

Conversation

@codope
Copy link
Owner

@codope codope commented Jul 21, 2021

…metadata as part of clustering

Fix clustering tests with commit metadata

Tips

What is the purpose of the pull request

(For example: This pull request adds quick-start document.)

Brief change log

(for example:)

  • Modify AnnotationLocation checkstyle rule in checkstyle.xml

Verify this pull request

(Please pick either of the following options)

This pull request is a trivial rework / code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end.
  • Added HoodieClientWriteTest to verify the change.
  • Manually verified the change by running a job locally.

Committer checklist

  • Has a corresponding JIRA in PR title & commit

  • Commit message is descriptive of the change

  • CI is green

  • Necessary doc changes done or have another open PR

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@satishkotha
Copy link

@codope Can you help tag places you made code changes on top of sk/clusteringImprovements branch ? This is a big PR, so it'll help me understand your changes better.


/**
* Pluggable implementation for writing data into new file groups based on ClusteringPlan.
*/
public abstract class ClusteringExecutionStrategy<T extends HoodieRecordPayload,I,K,O> implements Serializable {
public abstract class ClusteringExecutionStrategy<T extends HoodieRecordPayload, I, K, O> implements Serializable {
Copy link
Owner Author

Choose a reason for hiding this comment

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

@satishkotha One change in this class is that I have moved the transform() method to corresponding strategy classes. There is some duplicate code but due to virtual key changes I had to do that. Otherwise, we need significant refactoring i.e. move the HoodieSparkKeyGeneratorFactory and several key generators to hudi-client-common instead of hudi-spark-client.

HoodieFileReader<R> baseFileReader, HoodieMergedLogRecordScanner scanner, Schema schema, String payloadClass,
Option<Pair<String,String>> simpleKeyGenFieldsOpt) throws IOException {
Iterator<R> baseIterator = baseFileReader.getRecordIterator(schema);
while (baseIterator.hasNext()) {
GenericRecord record = (GenericRecord) baseIterator.next();
HoodieRecord<T> hoodieRecord = simpleKeyGenFieldsOpt.isPresent()
HoodieRecord<? extends HoodieRecordPayload> hoodieRecord = simpleKeyGenFieldsOpt.isPresent()
Copy link
Owner Author

Choose a reason for hiding this comment

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

/**
* Transform IndexedRecord into HoodieRecord.
*/
private HoodieRecord<T> transform(IndexedRecord indexedRecord) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

The transform method moved from ClusteringExecutionStrategy.

Copy link
Owner Author

@codope codope left a comment

Choose a reason for hiding this comment

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

@satishkotha I have commented where I have made changes. Apart from those files, I added tests in TestHoodieClientOnCopyOnWriteStorage and TestHoodieMergeOnReadTable.

…metadata as part of clustering

Fix clustering tests with commit metadata

Resolve conflicts

Resolve checkstyle issues
@codope codope force-pushed the sk/clusteringImprovements branch from b247b6e to c734fc2 Compare August 5, 2021 13:37
@codope codope closed this Aug 6, 2021
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