You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/01/19 23:50:22 UTC
[GitHub] [beam] boyuanzz opened a new pull request #13779: [WIP] Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
boyuanzz opened a new pull request #13779:
URL: https://github.com/apache/beam/pull/13779
**Please** add a meaningful description for your change here
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`).
- [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Dataflow | Flink | Samza | Spark | Twister2
--- | --- | --- | --- | --- | --- | ---
Go | [](https://ci-beam.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/) | --- | [](https://ci-beam.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/) | --- | [](https://ci-beam.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/) | ---
Java | [](https://ci-beam.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_VR_Dataflow_V2/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Java11/lastCompletedBuild/) | [](https://ci-beam
.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Java11/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Twister2/lastCompletedBuild/)
Python | [](https://ci-beam.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Python38/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Py_VR_Dataflow_V2/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PreCommit_Python_PVR_Flink_Cron/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Python_VR_Flink/lastCompletedBuild/) | --- | [](https://ci-beam.apache.org/job/beam_PostCommit_Python_VR_Spark/lastCompletedBuild/) | ---
XLang | [](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Direct/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Dataflow/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Flink/lastCompletedBuild/) | --- | [](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Spark/lastCompletedBuild/) | ---
Pre-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
--- |Java | Python | Go | Website | Whitespace | Typescript
--- | --- | --- | --- | --- | --- | ---
Non-portable | [](https://ci-beam.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/lastCompletedBuild/) <br>[](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/lastCompletedBuild/) | [](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Cron/lastCompletedBuild/)
Portable | --- | [](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/) | --- | --- | --- | ---
See [.test-infra/jenkins/README](https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md) for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (2419ef5) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **decrease** coverage by `0.01%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
==========================================
- Coverage 82.74% 82.73% -0.02%
==========================================
Files 466 466
Lines 57525 57530 +5
==========================================
- Hits 47599 47596 -3
- Misses 9926 9934 +8
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.05% <0.00%> (-0.84%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...2419ef5](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (04ae01c) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.75%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47608 +9
+ Misses 9926 9922 -4
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [...ks/python/apache\_beam/runners/worker/data\_plane.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvZGF0YV9wbGFuZS5weQ==) | `91.31% <0.00%> (+1.79%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...04ae01c](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (2419ef5) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **decrease** coverage by `0.01%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
==========================================
- Coverage 82.74% 82.73% -0.02%
==========================================
Files 466 466
Lines 57525 57530 +5
==========================================
- Hits 47599 47596 -3
- Misses 9926 9934 +8
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.05% <0.00%> (-0.84%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...2419ef5](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] TheNeuralBit commented on a change in pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
TheNeuralBit commented on a change in pull request #13779:
URL: https://github.com/apache/beam/pull/13779#discussion_r562281418
##########
File path: sdks/python/apache_beam/io/kafka.py
##########
@@ -152,8 +155,18 @@ def __init__(
for tests and demo applications.
:param max_read_time: Maximum amount of time in seconds the transform
executes. Mainly used for tests and demo applications.
+ :param commit_offset_in_finalize: Whether to commit offsets when finalizing.
+ :param timestamp_policy: The built-in timestamp policy which is used for
+ extracting timestamp from KafkaRecord.
:param expansion_service: The address (host:port) of the ExpansionService.
"""
+ if timestamp_policy not in [ReadFromKafka.processing_time_policy,
+ ReadFromKafka.create_time_policy,
+ ReadFromKafka.log_append_time]:
+ raise ValueError(
+ 'timestamp_policy should be one of '
+ '[ProcessingTime, CreateTime, LogAppendTime]')
Review comment:
nit: you might assign the allowed policies to a variable and re-use it to generate this error message.
##########
File path: sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
##########
@@ -586,8 +586,23 @@
setMaxReadTime(Duration.standardSeconds(config.maxReadTime));
}
setMaxNumRecords(config.maxNumRecords == null ? Long.MAX_VALUE : config.maxNumRecords);
- setCommitOffsetsInFinalizeEnabled(false);
- setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+
+ // Set committing offset configuration.
+ setCommitOffsetsInFinalizeEnabled(config.commitOffsetInFinalize);
+
+ // Set timestamp policy with built-in types.
+ String timestampPolicy = config.timestampPolicy;
+ if (timestampPolicy.equals("ProcessingTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+ } else if (timestampPolicy.equals("CreateTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withCreateTime(Duration.ZERO));
+ } else if (timestampPolicy.equals("LogAppendTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withLogAppendTime());
+ } else {
+ throw new IllegalArgumentException(
+ "timestampPolicy should be one of (ProcessingTime, CreateTime, LogAppendTime)");
+ }
Review comment:
:( sorry you have to add this logic for what's effectively an enumerated type.
This makes me want to prioritize implementing the EnumerationType logical type in portability and in Python. @chamikaramj would xlang folks be interested in picking that up? It seems like enumerated types will be a common need for external transform configuration.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (2419ef5) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **decrease** coverage by `0.01%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
==========================================
- Coverage 82.74% 82.73% -0.02%
==========================================
Files 466 466
Lines 57525 57530 +5
==========================================
- Hits 47599 47596 -3
- Misses 9926 9934 +8
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.05% <0.00%> (-0.84%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...04ae01c](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (598870a) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.74%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47605 +6
+ Misses 9926 9925 -1
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `89.69% <0.00%> (-0.16%)` | :arrow_down: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [sdks/python/apache\_beam/io/source\_test\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vc291cmNlX3Rlc3RfdXRpbHMucHk=) | `89.63% <0.00%> (+1.35%)` | :arrow_up: |
| [...hon/apache\_beam/runners/direct/test\_stream\_impl.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvdGVzdF9zdHJlYW1faW1wbC5weQ==) | `94.11% <0.00%> (+2.20%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...598870a](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] chamikaramj commented on a change in pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
chamikaramj commented on a change in pull request #13779:
URL: https://github.com/apache/beam/pull/13779#discussion_r562823775
##########
File path: sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
##########
@@ -586,8 +586,23 @@
setMaxReadTime(Duration.standardSeconds(config.maxReadTime));
}
setMaxNumRecords(config.maxNumRecords == null ? Long.MAX_VALUE : config.maxNumRecords);
- setCommitOffsetsInFinalizeEnabled(false);
- setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+
+ // Set committing offset configuration.
+ setCommitOffsetsInFinalizeEnabled(config.commitOffsetInFinalize);
+
+ // Set timestamp policy with built-in types.
+ String timestampPolicy = config.timestampPolicy;
+ if (timestampPolicy.equals("ProcessingTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+ } else if (timestampPolicy.equals("CreateTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withCreateTime(Duration.ZERO));
+ } else if (timestampPolicy.equals("LogAppendTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withLogAppendTime());
+ } else {
+ throw new IllegalArgumentException(
+ "timestampPolicy should be one of (ProcessingTime, CreateTime, LogAppendTime)");
+ }
Review comment:
+1. I created https://issues.apache.org/jira/browse/BEAM-11676 for tracking this. Please add any additional context.
In the meantime I think we can fallback to strings as Boyuan did here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] commented on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (598870a) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.74%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47605 +6
+ Misses 9926 9925 -1
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `89.69% <0.00%> (-0.16%)` | :arrow_down: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [sdks/python/apache\_beam/io/source\_test\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vc291cmNlX3Rlc3RfdXRpbHMucHk=) | `89.63% <0.00%> (+1.35%)` | :arrow_up: |
| [...hon/apache\_beam/runners/direct/test\_stream\_impl.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvdGVzdF9zdHJlYW1faW1wbC5weQ==) | `94.11% <0.00%> (+2.20%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...598870a](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (2419ef5) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **decrease** coverage by `0.01%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
==========================================
- Coverage 82.74% 82.73% -0.02%
==========================================
Files 466 466
Lines 57525 57530 +5
==========================================
- Hits 47599 47596 -3
- Misses 9926 9934 +8
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.05% <0.00%> (-0.84%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...2419ef5](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] boyuanzz commented on pull request #13779: [BEAM-11677] Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
boyuanzz commented on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-765628029
Thanks for the quick review! I'm going to merge this PR.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] boyuanzz commented on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
boyuanzz commented on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-764209922
Run Java PreCommit
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] boyuanzz commented on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
boyuanzz commented on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-764209922
Run Java PreCommit
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (04ae01c) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.75%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47608 +9
+ Misses 9926 9922 -4
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [...ks/python/apache\_beam/runners/worker/data\_plane.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvZGF0YV9wbGFuZS5weQ==) | `91.31% <0.00%> (+1.79%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...04ae01c](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (04ae01c) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.75%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47608 +9
+ Misses 9926 9922 -4
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [...ks/python/apache\_beam/runners/worker/data\_plane.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvZGF0YV9wbGFuZS5weQ==) | `91.31% <0.00%> (+1.79%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...04ae01c](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] TheNeuralBit commented on a change in pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
TheNeuralBit commented on a change in pull request #13779:
URL: https://github.com/apache/beam/pull/13779#discussion_r562281418
##########
File path: sdks/python/apache_beam/io/kafka.py
##########
@@ -152,8 +155,18 @@ def __init__(
for tests and demo applications.
:param max_read_time: Maximum amount of time in seconds the transform
executes. Mainly used for tests and demo applications.
+ :param commit_offset_in_finalize: Whether to commit offsets when finalizing.
+ :param timestamp_policy: The built-in timestamp policy which is used for
+ extracting timestamp from KafkaRecord.
:param expansion_service: The address (host:port) of the ExpansionService.
"""
+ if timestamp_policy not in [ReadFromKafka.processing_time_policy,
+ ReadFromKafka.create_time_policy,
+ ReadFromKafka.log_append_time]:
+ raise ValueError(
+ 'timestamp_policy should be one of '
+ '[ProcessingTime, CreateTime, LogAppendTime]')
Review comment:
nit: you might assign the allowed policies to a variable and re-use it to generate this error message.
##########
File path: sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
##########
@@ -586,8 +586,23 @@
setMaxReadTime(Duration.standardSeconds(config.maxReadTime));
}
setMaxNumRecords(config.maxNumRecords == null ? Long.MAX_VALUE : config.maxNumRecords);
- setCommitOffsetsInFinalizeEnabled(false);
- setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+
+ // Set committing offset configuration.
+ setCommitOffsetsInFinalizeEnabled(config.commitOffsetInFinalize);
+
+ // Set timestamp policy with built-in types.
+ String timestampPolicy = config.timestampPolicy;
+ if (timestampPolicy.equals("ProcessingTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+ } else if (timestampPolicy.equals("CreateTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withCreateTime(Duration.ZERO));
+ } else if (timestampPolicy.equals("LogAppendTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withLogAppendTime());
+ } else {
+ throw new IllegalArgumentException(
+ "timestampPolicy should be one of (ProcessingTime, CreateTime, LogAppendTime)");
+ }
Review comment:
:( sorry you have to add this logic for what's effectively an enumerated type.
This makes me want to prioritize implementing the EnumerationType logical type in portability and in Python. @chamikaramj would xlang folks be interested in picking that up? It seems like enumerated types will be a common need for external transform configuration.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (2419ef5) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **decrease** coverage by `0.01%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
==========================================
- Coverage 82.74% 82.73% -0.02%
==========================================
Files 466 466
Lines 57525 57530 +5
==========================================
- Hits 47599 47596 -3
- Misses 9926 9934 +8
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.05% <0.00%> (-0.84%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...2419ef5](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (598870a) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.74%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47605 +6
+ Misses 9926 9925 -1
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `89.69% <0.00%> (-0.16%)` | :arrow_down: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [sdks/python/apache\_beam/io/source\_test\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vc291cmNlX3Rlc3RfdXRpbHMucHk=) | `89.63% <0.00%> (+1.35%)` | :arrow_up: |
| [...hon/apache\_beam/runners/direct/test\_stream\_impl.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvdGVzdF9zdHJlYW1faW1wbC5weQ==) | `94.11% <0.00%> (+2.20%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...598870a](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] commented on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (598870a) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.74%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47605 +6
+ Misses 9926 9925 -1
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `89.69% <0.00%> (-0.16%)` | :arrow_down: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [sdks/python/apache\_beam/io/source\_test\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vc291cmNlX3Rlc3RfdXRpbHMucHk=) | `89.63% <0.00%> (+1.35%)` | :arrow_up: |
| [...hon/apache\_beam/runners/direct/test\_stream\_impl.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvdGVzdF9zdHJlYW1faW1wbC5weQ==) | `94.11% <0.00%> (+2.20%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...598870a](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] boyuanzz commented on a change in pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
boyuanzz commented on a change in pull request #13779:
URL: https://github.com/apache/beam/pull/13779#discussion_r562285062
##########
File path: sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
##########
@@ -586,8 +586,23 @@
setMaxReadTime(Duration.standardSeconds(config.maxReadTime));
}
setMaxNumRecords(config.maxNumRecords == null ? Long.MAX_VALUE : config.maxNumRecords);
- setCommitOffsetsInFinalizeEnabled(false);
- setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+
+ // Set committing offset configuration.
+ setCommitOffsetsInFinalizeEnabled(config.commitOffsetInFinalize);
+
+ // Set timestamp policy with built-in types.
+ String timestampPolicy = config.timestampPolicy;
+ if (timestampPolicy.equals("ProcessingTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+ } else if (timestampPolicy.equals("CreateTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withCreateTime(Duration.ZERO));
+ } else if (timestampPolicy.equals("LogAppendTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withLogAppendTime());
+ } else {
+ throw new IllegalArgumentException(
+ "timestampPolicy should be one of (ProcessingTime, CreateTime, LogAppendTime)");
+ }
Review comment:
+1 for `EnumerationType`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] boyuanzz merged pull request #13779: [BEAM-11677] Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
boyuanzz merged pull request #13779:
URL: https://github.com/apache/beam/pull/13779
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (04ae01c) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.75%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47608 +9
+ Misses 9926 9922 -4
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [...ks/python/apache\_beam/runners/worker/data\_plane.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvZGF0YV9wbGFuZS5weQ==) | `91.31% <0.00%> (+1.79%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...04ae01c](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (598870a) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.74%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47605 +6
+ Misses 9926 9925 -1
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `89.69% <0.00%> (-0.16%)` | :arrow_down: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [sdks/python/apache\_beam/io/source\_test\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vc291cmNlX3Rlc3RfdXRpbHMucHk=) | `89.63% <0.00%> (+1.35%)` | :arrow_up: |
| [...hon/apache\_beam/runners/direct/test\_stream\_impl.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvdGVzdF9zdHJlYW1faW1wbC5weQ==) | `94.11% <0.00%> (+2.20%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...598870a](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (04ae01c) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.75%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47608 +9
+ Misses 9926 9922 -4
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.70% <0.00%> (+0.25%)` | :arrow_up: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [...ks/python/apache\_beam/runners/worker/data\_plane.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvZGF0YV9wbGFuZS5weQ==) | `91.31% <0.00%> (+1.79%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...04ae01c](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763894682
# [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=h1) Report
> Merging [#13779](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=desc) (598870a) into [master](https://codecov.io/gh/apache/beam/commit/334020f6256b656925449c202bfed5c5393080d2?el=desc) (334020f) will **increase** coverage by `0.00%`.
> The diff coverage is `60.00%`.
[](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #13779 +/- ##
=======================================
Coverage 82.74% 82.74%
=======================================
Files 466 466
Lines 57525 57530 +5
=======================================
+ Hits 47599 47605 +6
+ Misses 9926 9925 -1
```
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/kafka.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8va2Fma2EucHk=) | `80.76% <60.00%> (-4.95%)` | :arrow_down: |
| [sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=) | `86.45% <0.00%> (-1.05%)` | :arrow_down: |
| [sdks/python/apache\_beam/dataframe/frames.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL2ZyYW1lcy5weQ==) | `91.46% <0.00%> (-0.42%)` | :arrow_down: |
| [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `89.69% <0.00%> (-0.16%)` | :arrow_down: |
| [...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==) | `90.28% <0.00%> (+0.35%)` | :arrow_up: |
| [sdks/python/apache\_beam/io/source\_test\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vc291cmNlX3Rlc3RfdXRpbHMucHk=) | `89.63% <0.00%> (+1.35%)` | :arrow_up: |
| [...hon/apache\_beam/runners/direct/test\_stream\_impl.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvdGVzdF9zdHJlYW1faW1wbC5weQ==) | `94.11% <0.00%> (+2.20%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/13779/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `92.85% <0.00%> (+4.76%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=footer). Last update [cdc7226...2419ef5](https://codecov.io/gh/apache/beam/pull/13779?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] boyuanzz commented on a change in pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
boyuanzz commented on a change in pull request #13779:
URL: https://github.com/apache/beam/pull/13779#discussion_r562285062
##########
File path: sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
##########
@@ -586,8 +586,23 @@
setMaxReadTime(Duration.standardSeconds(config.maxReadTime));
}
setMaxNumRecords(config.maxNumRecords == null ? Long.MAX_VALUE : config.maxNumRecords);
- setCommitOffsetsInFinalizeEnabled(false);
- setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+
+ // Set committing offset configuration.
+ setCommitOffsetsInFinalizeEnabled(config.commitOffsetInFinalize);
+
+ // Set timestamp policy with built-in types.
+ String timestampPolicy = config.timestampPolicy;
+ if (timestampPolicy.equals("ProcessingTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withProcessingTime());
+ } else if (timestampPolicy.equals("CreateTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withCreateTime(Duration.ZERO));
+ } else if (timestampPolicy.equals("LogAppendTime")) {
+ setTimestampPolicyFactory(TimestampPolicyFactory.withLogAppendTime());
+ } else {
+ throw new IllegalArgumentException(
+ "timestampPolicy should be one of (ProcessingTime, CreateTime, LogAppendTime)");
+ }
Review comment:
+1 for `EnumerationType`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] boyuanzz commented on pull request #13779: Expose commit_offset_in_finalize and timestamp_policy to ReadFromKafka.
Posted by GitBox <gi...@apache.org>.
boyuanzz commented on pull request #13779:
URL: https://github.com/apache/beam/pull/13779#issuecomment-763886359
r: @chamikaramj @TheNeuralBit
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org