Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[HUDI-6015] Refresh the table after executing rollback and restoreToSavepoint #8352

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

huangxiaopingRD
Copy link
Contributor

Change Logs

Spark will cache some meta information of the table. After the RollbackToInstantTimeProcedure is executed on the table, the meta information will change and the table needs to be refreshed. Otherwise, the following error will occur when querying the data again:

Caused by: java.io.FileNotFoundException: File does not exist: hdfs://xxxxx/user/hive/warehouse/hudi_cow_nonpcf_tbl2/7a19abfb-35ab-40bb-9580-6b1af681506a-0_0-23-20_20230402002001284.parquet
It is possible the underlying files have been updated. You can explicitly invalidate the cache in Spark by running 'REFRESH TABLE tableName' command in SQL or by recreating the Dataset/DataFrame involved.
	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.org$apache$spark$sql$execution$datasources$FileScanRDD$$anon$$readCurrentFile(FileScanRDD.scala:124)
	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.nextIterator(FileScanRDD.scala:187)
	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.hasNext(FileScanRDD.scala:93)
	at org.apache.spark.sql.execution.FileSourceScanExec$$anon$1.hasNext(DataSourceScanExec.scala:503)

Impact

No

Risk level (write none, low medium or high below)

none

Documentation Update

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

Copy link
Contributor

@bvaradar bvaradar left a comment

Choose a reason for hiding this comment

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

Good catch. Can you also add similar refresh in RollbackToSavepointProcedure.scala. Can you also add a test-case for this ?

@huangxiaopingRD huangxiaopingRD force-pushed the HUDI-6015-refresh-table branch from 254680e to b316815 Compare April 18, 2023 11:56
@huangxiaopingRD
Copy link
Contributor Author

Good catch. Can you also add similar refresh in RollbackToSavepointProcedure.scala. Can you also add a test-case for this ?

Done

@huangxiaopingRD huangxiaopingRD changed the title [HUDI-6015] Refresh the table after executing rollback to instantTime [HUDI-6015] Refresh the table after executing rollback and restoreToSavepoint Apr 18, 2023
@hudi-bot
Copy link

CI report:

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

Copy link
Contributor

@bvaradar bvaradar left a comment

Choose a reason for hiding this comment

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

LGTM.

@bvaradar bvaradar merged commit faf1844 into apache:master Apr 19, 2023
@huangxiaopingRD huangxiaopingRD deleted the HUDI-6015-refresh-table branch April 19, 2023 03:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants