You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "lokesh-lingarajan-0310 (via GitHub)" <gi...@apache.org> on 2023/08/11 20:13:31 UTC
[GitHub] [hudi] lokesh-lingarajan-0310 opened a new pull request, #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
lokesh-lingarajan-0310 opened a new pull request, #9433:
URL: https://github.com/apache/hudi/pull/9433
### Change Logs
Handling empty commit and returning current batch's endpoint to handle scenarios of customer configuring filters for specific objects in s3 among other objects.
### Risk level (write none, low medium or high below)
Medium
### Contributor's checklist
- [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [x] Change Logs and Impact were stated clearly
- [x] Adequate tests were added if applicable
- [x] CI passed
--
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] lokesh-lingarajan-0310 commented on a diff in pull request #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
Posted by "lokesh-lingarajan-0310 (via GitHub)" <gi...@apache.org>.
lokesh-lingarajan-0310 commented on code in PR #9433:
URL: https://github.com/apache/hudi/pull/9433#discussion_r1291842978
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/IncrSourceHelper.java:
##########
@@ -219,7 +218,7 @@ public static Pair<CloudObjectIncrCheckpoint, Dataset<Row>> filterAndGenerateChe
}
LOG.info("Processed batch size: " + row.get(row.fieldIndex(CUMULATIVE_COLUMN_NAME)) + " bytes");
sourceData.unpersist();
- return Pair.of(new CloudObjectIncrCheckpoint(row.getString(0), row.getString(1)), collectedRows);
+ return Pair.of(new CloudObjectIncrCheckpoint(row.getString(0), row.getString(1)), Option.of(collectedRows));
Review Comment:
https://issues.apache.org/jira/browse/HUDI-6687
--
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] lokesh-lingarajan-0310 commented on a diff in pull request #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
Posted by "lokesh-lingarajan-0310 (via GitHub)" <gi...@apache.org>.
lokesh-lingarajan-0310 commented on code in PR #9433:
URL: https://github.com/apache/hudi/pull/9433#discussion_r1294712040
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/S3EventsHoodieIncrSource.java:
##########
@@ -157,26 +157,24 @@ public Pair<Option<Dataset<Row>>, String> fetchNextBatch(Option<String> lastChec
}
Dataset<Row> source = queryRunner.run(queryInfo);
- if (source.isEmpty()) {
- LOG.info("Source of file names is empty. Returning empty result and endInstant: "
- + queryInfo.getEndInstant());
- return Pair.of(Option.empty(), queryInfo.getEndInstant());
- }
-
Dataset<Row> filteredSourceData = applyFilter(source, fileFormat);
LOG.info("Adjusting end checkpoint:" + queryInfo.getEndInstant() + " based on sourceLimit :" + sourceLimit);
- Pair<CloudObjectIncrCheckpoint, Dataset<Row>> checkPointAndDataset =
+ Pair<CloudObjectIncrCheckpoint, Option<Dataset<Row>>> checkPointAndDataset =
IncrSourceHelper.filterAndGenerateCheckpointBasedOnSourceLimit(
filteredSourceData, sourceLimit, queryInfo, cloudObjectIncrCheckpoint);
+ if (!checkPointAndDataset.getRight().isPresent()) {
+ LOG.info("Empty source, returning endpoint:" + queryInfo.getEndInstant());
+ return Pair.of(Option.empty(), queryInfo.getEndInstant());
+ }
LOG.info("Adjusted end checkpoint :" + checkPointAndDataset.getLeft());
String s3FS = getStringWithAltKeys(props, S3_FS_PREFIX, true).toLowerCase();
String s3Prefix = s3FS + "://";
// Create S3 paths
SerializableConfiguration serializableHadoopConf = new SerializableConfiguration(sparkContext.hadoopConfiguration());
- List<CloudObjectMetadata> cloudObjectMetadata = checkPointAndDataset.getRight()
+ List<CloudObjectMetadata> cloudObjectMetadata = checkPointAndDataset.getRight().get()
Review Comment:
we are doing that in line 166
--
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] nsivabalan merged pull request #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan merged PR #9433:
URL: https://github.com/apache/hudi/pull/9433
--
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] amrishlal commented on a diff in pull request #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
Posted by "amrishlal (via GitHub)" <gi...@apache.org>.
amrishlal commented on code in PR #9433:
URL: https://github.com/apache/hudi/pull/9433#discussion_r1291826591
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/IncrSourceHelper.java:
##########
@@ -219,7 +218,7 @@ public static Pair<CloudObjectIncrCheckpoint, Dataset<Row>> filterAndGenerateChe
}
LOG.info("Processed batch size: " + row.get(row.fieldIndex(CUMULATIVE_COLUMN_NAME)) + " bytes");
sourceData.unpersist();
- return Pair.of(new CloudObjectIncrCheckpoint(row.getString(0), row.getString(1)), collectedRows);
+ return Pair.of(new CloudObjectIncrCheckpoint(row.getString(0), row.getString(1)), Option.of(collectedRows));
Review Comment:
Minor: Would suggest using row.fieldIndex just like what you have for `CUMULATIVE_COLUMN_NAME1`
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/IncrSourceHelper.java:
##########
@@ -219,7 +218,7 @@ public static Pair<CloudObjectIncrCheckpoint, Dataset<Row>> filterAndGenerateChe
}
LOG.info("Processed batch size: " + row.get(row.fieldIndex(CUMULATIVE_COLUMN_NAME)) + " bytes");
sourceData.unpersist();
- return Pair.of(new CloudObjectIncrCheckpoint(row.getString(0), row.getString(1)), collectedRows);
+ return Pair.of(new CloudObjectIncrCheckpoint(row.getString(0), row.getString(1)), Option.of(collectedRows));
Review Comment:
Also, please open a ticket for optimizations that we were discussing offline (Use of `applyOrdering` in line 182 and `commit_key` temporary column)
--
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 #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9433:
URL: https://github.com/apache/hudi/pull/9433#issuecomment-1675397975
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e 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 #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9433:
URL: https://github.com/apache/hudi/pull/9433#issuecomment-1675545141
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=19271",
"triggerID" : "32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=19271)
<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 #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9433:
URL: https://github.com/apache/hudi/pull/9433#issuecomment-1675404838
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=19271",
"triggerID" : "32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 32538d15eea7ed25ca8f0f8efbdd2bd1c21fa41e Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=19271)
<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] codope commented on a diff in pull request #9433: [HUDI-6686] - Handling empty commits after s3 applyFilter api
Posted by "codope (via GitHub)" <gi...@apache.org>.
codope commented on code in PR #9433:
URL: https://github.com/apache/hudi/pull/9433#discussion_r1294252246
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/S3EventsHoodieIncrSource.java:
##########
@@ -157,26 +157,24 @@ public Pair<Option<Dataset<Row>>, String> fetchNextBatch(Option<String> lastChec
}
Dataset<Row> source = queryRunner.run(queryInfo);
- if (source.isEmpty()) {
- LOG.info("Source of file names is empty. Returning empty result and endInstant: "
- + queryInfo.getEndInstant());
- return Pair.of(Option.empty(), queryInfo.getEndInstant());
- }
-
Dataset<Row> filteredSourceData = applyFilter(source, fileFormat);
LOG.info("Adjusting end checkpoint:" + queryInfo.getEndInstant() + " based on sourceLimit :" + sourceLimit);
- Pair<CloudObjectIncrCheckpoint, Dataset<Row>> checkPointAndDataset =
+ Pair<CloudObjectIncrCheckpoint, Option<Dataset<Row>>> checkPointAndDataset =
IncrSourceHelper.filterAndGenerateCheckpointBasedOnSourceLimit(
filteredSourceData, sourceLimit, queryInfo, cloudObjectIncrCheckpoint);
+ if (!checkPointAndDataset.getRight().isPresent()) {
+ LOG.info("Empty source, returning endpoint:" + queryInfo.getEndInstant());
+ return Pair.of(Option.empty(), queryInfo.getEndInstant());
+ }
LOG.info("Adjusted end checkpoint :" + checkPointAndDataset.getLeft());
String s3FS = getStringWithAltKeys(props, S3_FS_PREFIX, true).toLowerCase();
String s3Prefix = s3FS + "://";
// Create S3 paths
SerializableConfiguration serializableHadoopConf = new SerializableConfiguration(sparkContext.hadoopConfiguration());
- List<CloudObjectMetadata> cloudObjectMetadata = checkPointAndDataset.getRight()
+ List<CloudObjectMetadata> cloudObjectMetadata = checkPointAndDataset.getRight().get()
Review Comment:
Can the Option be empty or nullable? Should we check before calling get() on Option?
--
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