You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/07/21 04:56:34 UTC
[GitHub] [hudi] rahil-c opened a new pull request, #6159: Invalidate cached table in Spark after write
rahil-c opened a new pull request, #6159:
URL: https://github.com/apache/hudi/pull/6159
## *Tips*
- *Thank you very much for contributing to Apache Hudi.*
- *Please review https://hudi.apache.org/contribute/how-to-contribute before opening a pull request.*
## 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] rahil-c commented on pull request #6159: Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
rahil-c commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1191703134
Azure ci timing out https://dev.azure.com/apache-hudi-ci-org/apache-hudi-ci/_build/results?buildId=10124&view=results
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] umehrot2 commented on a diff in pull request #6159: [HUDI-4436] Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
umehrot2 commented on code in PR #6159:
URL: https://github.com/apache/hudi/pull/6159#discussion_r928021824
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala:
##########
@@ -638,9 +638,37 @@ object HoodieSparkSqlWriter {
SyncUtilHelpers.runHoodieMetaSync(impl.trim, properties, fs.getConf, fs, basePath.toString, baseFileFormat)
})
}
+
+ // Since Hive tables are now synced as Spark data source tables which are cached after Spark SQL queries
+ // we must invalidate this table in the cache so writes are reflected in later queries
+ if (metaSyncEnabled) {
+ getHiveTableNames(hoodieConfig).foreach(name => {
+ val qualifiedTableName = String.join(".", hoodieConfig.getStringOrDefault(HIVE_DATABASE), name)
+ if (spark.catalog.tableExists(qualifiedTableName)) {
+ spark.catalog.refreshTable(qualifiedTableName)
+ }
Review Comment:
Ack.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #6159: [HUDI-4436] Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1193029458
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "68956079898aae18e989342cf16cfc5496bc7987",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124",
"triggerID" : "68956079898aae18e989342cf16cfc5496bc7987",
"triggerType" : "PUSH"
}, {
"hash" : "73d25d393e50a9fb48c1cbe9c69f093cd9256af7",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10234",
"triggerID" : "73d25d393e50a9fb48c1cbe9c69f093cd9256af7",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 68956079898aae18e989342cf16cfc5496bc7987 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124)
* 73d25d393e50a9fb48c1cbe9c69f093cd9256af7 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10234)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #6159: [HUDI-4436] Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1193028517
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "68956079898aae18e989342cf16cfc5496bc7987",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124",
"triggerID" : "68956079898aae18e989342cf16cfc5496bc7987",
"triggerType" : "PUSH"
}, {
"hash" : "73d25d393e50a9fb48c1cbe9c69f093cd9256af7",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "73d25d393e50a9fb48c1cbe9c69f093cd9256af7",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 68956079898aae18e989342cf16cfc5496bc7987 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124)
* 73d25d393e50a9fb48c1cbe9c69f093cd9256af7 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #6159: [HUDI-4436] Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1193057014
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "68956079898aae18e989342cf16cfc5496bc7987",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124",
"triggerID" : "68956079898aae18e989342cf16cfc5496bc7987",
"triggerType" : "PUSH"
}, {
"hash" : "73d25d393e50a9fb48c1cbe9c69f093cd9256af7",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10234",
"triggerID" : "73d25d393e50a9fb48c1cbe9c69f093cd9256af7",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 73d25d393e50a9fb48c1cbe9c69f093cd9256af7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10234)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #6159: Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1191058129
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "68956079898aae18e989342cf16cfc5496bc7987",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "68956079898aae18e989342cf16cfc5496bc7987",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 68956079898aae18e989342cf16cfc5496bc7987 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] yihua merged pull request #6159: [HUDI-4436] Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
yihua merged PR #6159:
URL: https://github.com/apache/hudi/pull/6159
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #6159: Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1191060870
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "68956079898aae18e989342cf16cfc5496bc7987",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124",
"triggerID" : "68956079898aae18e989342cf16cfc5496bc7987",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 68956079898aae18e989342cf16cfc5496bc7987 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] yihua commented on pull request #6159: [HUDI-4436] Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
yihua commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1193066164
IT failure is due to Flink which is unrelated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] rahil-c commented on pull request #6159: [HUDI-4436] Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
rahil-c commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1191833268
Sounds good thanks @codope i think @umehrot2 will also take a second look as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] codope commented on a diff in pull request #6159: [HUDI-4436] Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
codope commented on code in PR #6159:
URL: https://github.com/apache/hudi/pull/6159#discussion_r927016415
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala:
##########
@@ -638,9 +638,37 @@ object HoodieSparkSqlWriter {
SyncUtilHelpers.runHoodieMetaSync(impl.trim, properties, fs.getConf, fs, basePath.toString, baseFileFormat)
})
}
+
+ // Since Hive tables are now synced as Spark data source tables which are cached after Spark SQL queries
+ // we must invalidate this table in the cache so writes are reflected in later queries
+ if (metaSyncEnabled) {
+ getHiveTableNames(hoodieConfig).foreach(name => {
+ val qualifiedTableName = String.join(".", hoodieConfig.getStringOrDefault(HIVE_DATABASE), name)
+ if (spark.catalog.tableExists(qualifiedTableName)) {
+ spark.catalog.refreshTable(qualifiedTableName)
+ }
Review Comment:
We can move this inside the if-block above. It's basically the same condition.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] rahil-c commented on pull request #6159: Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
rahil-c commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1191038741
cc @umehrot2 @zhedoubushishi
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #6159: Invalidate cached table in Spark after write
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6159:
URL: https://github.com/apache/hudi/pull/6159#issuecomment-1191347038
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "68956079898aae18e989342cf16cfc5496bc7987",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124",
"triggerID" : "68956079898aae18e989342cf16cfc5496bc7987",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 68956079898aae18e989342cf16cfc5496bc7987 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10124)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org