Skip to content

Conversation

@xicm
Copy link
Contributor

@xicm xicm commented Jul 30, 2022

Tips

What is the purpose of the pull request

When I read hudi table with spark readStream, FileNotFoundException happens after a while. This happens when a compaction happens and completes quickly while reading, deleting the file that was being read. Details I described at jira ticket.

The code I read hudi

    val df: DataFrame = spark.readStream.format("org.apache.hudi")
      .load("hdfs://10.19.29.148:8020/tmp/hudi/ss_bucket")
    df.writeStream
      .format("console")
      .trigger(Trigger.ProcessingTime("5 seconds"))
      .option("checkpointLocation", "/tmp/hoodie/checkpoint_xicm")
      .start()
      .awaitTermination()

It seems that there is no mechanism to ensure no compaction while doing incremental read.

Because of the checkpoint the job can't succeed even after a restart.
This pr filter files not exist to make stream read successful after a spark retry.

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.

@xicm
Copy link
Contributor Author

xicm commented Jul 30, 2022

This fix is not good, is there any advice I can go into?

@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@danny0405
Copy link
Contributor

Maybe this is what you need: #6141

@xicm
Copy link
Contributor Author

xicm commented Aug 1, 2022

Maybe this is what you need: #6141

Hi @danny0405 , thanks for your help.
Alse check with you, can #6096 solve the FileNotFoundException in flink stream read?

@xicm
Copy link
Contributor Author

xicm commented Aug 1, 2022

Will be fixed by #6141

@xicm xicm closed this Aug 1, 2022
@danny0405
Copy link
Contributor

Maybe this is what you need: #6141

Hi @danny0405 , thanks for your help. Alse check with you, can #6096 solve the FileNotFoundException in flink stream read?

No, #6090 would only solve the incremental read for batch mode.

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