Davis Zhang created HUDI-9094:
---------------------------------

             Summary: when writing instant file we should avoid directly write 
byte []
                 Key: HUDI-9094
                 URL: https://issues.apache.org/jira/browse/HUDI-9094
             Project: Apache Hudi
          Issue Type: Bug
            Reporter: Davis Zhang


{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 []. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to