apache / apache/hudi

when writing instant file we should avoid directly write byte []

Open
#17,383 1 comment 0 reactions 1 assignee Assigned to @yihua View on GitHub
from-jira priority:high release-1.1.0 type:devtask
Dominant language
Java
Stars
6.2k
Forks
2.5k
Avg merge
2d 8h
Merged PRs (30d)
111

Description

{code:java}
@Override
public void persistHistorySchemaStr(String instantTime, String historySchemaStr) {
cleanResidualFiles();
HoodieActiveTimeline timeline = getMetaClient().getActiveTimeline();
HoodieInstant hoodieInstant = metaClient.createNewInstant(HoodieInstant.State.REQUESTED, SCHEMA_COMMIT_ACTION, instantTime);
timeline.createNewInstant(hoodieInstant);
byte[] writeContent = getUTF8Bytes(historySchemaStr);
timeline.transitionRequestedToInflight(hoodieInstant, Option.empty());
timeline.saveAsComplete(false, metaClient.createNewInstant(
HoodieInstant.State.INFLIGHT, hoodieInstant.getAction(), hoodieInstant.requestedTime()), Option.of(HoodieInstantWriter.convertByteArrayToWriter(writeContent)));
LOG.info(String.format("persist history schema success on commit time: %s", instantTime));
} {code}
the saveAsComplete should not give writeContent which is a raw byte []. 

## JIRA info

- Link: https://issues.apache.org/jira/browse/HUDI-9094
- Type: Sub-task
- Parent: https://issues.apache.org/jira/browse/HUDI-9054
- Fix version(s):
- 1.1.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.