You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/02/18 02:08:40 UTC
[GitHub] [incubator-gobblin] KumaravelKandasami opened a new pull request
#2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
KumaravelKandasami opened a new pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
### JIRA
- [x] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN-1054) "GOBBLIN-1054: Refactor HiveSource to make partition filter extensible"
- https://issues.apache.org/jira/browse/GOBBLIN-1054
### Description
- [x] Refactor HiveSource to handle different partition filter.
Currently the default partition filter is the LookbackPartitionFilter, this change allows dynamic parition filters through runtime configuration. Added DateRangePartitionFilter along with this PR.
### Tests
- [X] Added following unit tests
LookbackPartitionFilterGeneratorTest.java
DateRangePartitionFilterGeneratorTest.java
### Commits
- [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
2. Subject is limited to 50 characters
3. Subject does not end with a period
4. Subject uses the imperative mood ("add", not "adding")
5. Body wraps at 72 characters
6. Body explains "what" and "why", not "how"
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] codecov-io commented on issue #2894:
GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#issuecomment-587259006
# [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?src=pr&el=h1) Report
> Merging [#2894](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/166eb725c01c279068aaefa2c9af93c907bd9eff?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `67.5%`.
[](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #2894 +/- ##
============================================
+ Coverage 45.81% 45.82% +<.01%
- Complexity 9148 9153 +5
============================================
Files 1929 1930 +1
Lines 72602 72624 +22
Branches 7993 7998 +5
============================================
+ Hits 33264 33277 +13
+ Misses 36303 36299 -4
- Partials 3035 3048 +13
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [.../management/conversion/hive/source/HiveSource.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvbnZlcnNpb24vaGl2ZS9zb3VyY2UvSGl2ZVNvdXJjZS5qYXZh) | `66.85% <100%> (+3.26%)` | `24 <0> (ø)` | :arrow_down: |
| [...hive/filter/DateRangePartitionFilterGenerator.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvaGl2ZS9maWx0ZXIvRGF0ZVJhbmdlUGFydGl0aW9uRmlsdGVyR2VuZXJhdG9yLmphdmE=) | `50% <50%> (ø)` | `4 <4> (?)` | |
| [.../hive/filter/LookbackPartitionFilterGenerator.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvaGl2ZS9maWx0ZXIvTG9va2JhY2tQYXJ0aXRpb25GaWx0ZXJHZW5lcmF0b3IuamF2YQ==) | `78.94% <76.47%> (-21.06%)` | `6 <5> (+3)` | |
| [...lin/util/filesystem/FileSystemInstrumentation.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvZmlsZXN5c3RlbS9GaWxlU3lzdGVtSW5zdHJ1bWVudGF0aW9uLmphdmE=) | `85.71% <0%> (-7.15%)` | `3% <0%> (ø)` | |
| [...in/java/org/apache/gobblin/cluster/HelixUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvSGVsaXhVdGlscy5qYXZh) | `38.93% <0%> (-3.54%)` | `14% <0%> (-1%)` | |
| [...he/gobblin/writer/FineGrainedWatermarkTracker.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb3JlLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vd3JpdGVyL0ZpbmVHcmFpbmVkV2F0ZXJtYXJrVHJhY2tlci5qYXZh) | `82.25% <0%> (-2.42%)` | `28% <0%> (-1%)` | |
| [...he/gobblin/metrics/reporter/ScheduledReporter.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1tZXRyaWNzLWxpYnMvZ29iYmxpbi1tZXRyaWNzLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vbWV0cmljcy9yZXBvcnRlci9TY2hlZHVsZWRSZXBvcnRlci5qYXZh) | `59.09% <0%> (-1.52%)` | `14% <0%> (-1%)` | |
| [.../apache/gobblin/runtime/api/JobExecutionState.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvYXBpL0pvYkV4ZWN1dGlvblN0YXRlLmphdmE=) | `79.43% <0%> (-0.94%)` | `24% <0%> (ø)` | |
| [.../org/apache/gobblin/cluster/GobblinTaskRunner.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvR29iYmxpblRhc2tSdW5uZXIuamF2YQ==) | `65.5% <0%> (+0.43%)` | `29% <0%> (ø)` | :arrow_down: |
| ... and [3 more](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?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/incubator-gobblin/pull/2894?src=pr&el=footer). Last update [166eb72...9839b40](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] KumaravelKandasami commented on a change in
pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition
filter extensible
Posted by GitBox <gi...@apache.org>.
KumaravelKandasami commented on a change in pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#discussion_r383703426
##########
File path: gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/filter/LookbackPartitionFilterGenerator.java
##########
@@ -41,34 +40,44 @@
* must be such that lexycographical string and date ordering are compatible.
* </p>
*/
+@Slf4j
public class LookbackPartitionFilterGenerator implements PartitionFilterGenerator {
public static final String PARTITION_COLUMN = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.column";
public static final String LOOKBACK = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.lookback";
public static final String DATETIME_FORMAT = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.format";
- private static final String ERROR_MESSAGE = LookbackPartitionFilterGenerator.class.getName()
- + " requires the following properties " + Arrays.toString(new String[]{PARTITION_COLUMN, LOOKBACK, DATETIME_FORMAT});
-
- private final String partitionColumn;
- private final Period lookback;
- private final DateTimeFormatter formatter;
+ private final Properties prop;
public LookbackPartitionFilterGenerator(Properties properties) {
- Preconditions.checkArgument(properties.containsKey(PARTITION_COLUMN), ERROR_MESSAGE);
- Preconditions.checkArgument(properties.containsKey(LOOKBACK), ERROR_MESSAGE);
- Preconditions.checkArgument(properties.containsKey(DATETIME_FORMAT), ERROR_MESSAGE);
-
- this.partitionColumn = properties.getProperty(PARTITION_COLUMN);
- this.lookback = Period.parse(properties.getProperty(LOOKBACK));
- this.formatter = DateTimeFormat.forPattern(properties.getProperty(DATETIME_FORMAT));
+ this.prop = (properties == null) ? System.getProperties(): properties;
}
@Override
public String getFilter(HiveDataset hiveDataset) {
- DateTime limitDate = (new DateTime()).minus(this.lookback);
+ if (isValidConfig()) {
Review comment:
I do agree with you on keeping the code backward compatible, however, the prior implementation of the `HiveSource.java `checks whether the expected properties for `LookbackPartitionFilterGenerator` exists before instantiating the `LookbackPartitionFilterGenerator`, so the `IllegalArgumentException` is never raised during runtime. Also, the prior implementation of the `HiveSource.java `support no PartitionFilter case. To support these existing behavior, we cannot throw exception when the validation fails.
Reference to prior implementation of `HiveSource.java`:
https://github.com/apache/incubator-gobblin/pull/2894/commits/dca6e665020b147c4009f0f23511c228c64415b6#diff-071355ec76a4f7e8167359040ff492f0L306-L313
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] KumaravelKandasami commented on a change in
pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition
filter extensible
Posted by GitBox <gi...@apache.org>.
KumaravelKandasami commented on a change in pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#discussion_r383705102
##########
File path: gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/source/HiveSource.java
##########
@@ -27,6 +27,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
+import org.apache.gobblin.data.management.copy.hive.PartitionFilterGenerator;
Review comment:
Fixed. Thank you.
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] asfgit closed pull request #2894: GOBBLIN-1054:
Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request
#2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
autumnust commented on a change in pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#discussion_r382304604
##########
File path: gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/filter/LookbackPartitionFilterGenerator.java
##########
@@ -41,34 +40,44 @@
* must be such that lexycographical string and date ordering are compatible.
* </p>
*/
+@Slf4j
public class LookbackPartitionFilterGenerator implements PartitionFilterGenerator {
public static final String PARTITION_COLUMN = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.column";
public static final String LOOKBACK = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.lookback";
public static final String DATETIME_FORMAT = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.format";
- private static final String ERROR_MESSAGE = LookbackPartitionFilterGenerator.class.getName()
- + " requires the following properties " + Arrays.toString(new String[]{PARTITION_COLUMN, LOOKBACK, DATETIME_FORMAT});
-
- private final String partitionColumn;
- private final Period lookback;
- private final DateTimeFormatter formatter;
+ private final Properties prop;
public LookbackPartitionFilterGenerator(Properties properties) {
- Preconditions.checkArgument(properties.containsKey(PARTITION_COLUMN), ERROR_MESSAGE);
Review comment:
Can you keep these ERROR_MESSAGE in your `isValidConfig` method?
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] autumnust commented on issue #2894:
GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
autumnust commented on issue #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#issuecomment-592275598
+1 LGTM. Thanks for the contribution. @KumaravelKandasami
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] KumaravelKandasami commented on issue #2894:
GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
KumaravelKandasami commented on issue #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#issuecomment-587281114
@autumnust Please review the PR. Thank you.
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request
#2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
autumnust commented on a change in pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#discussion_r382314594
##########
File path: gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/filter/LookbackPartitionFilterGenerator.java
##########
@@ -41,34 +40,44 @@
* must be such that lexycographical string and date ordering are compatible.
* </p>
*/
+@Slf4j
public class LookbackPartitionFilterGenerator implements PartitionFilterGenerator {
public static final String PARTITION_COLUMN = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.column";
public static final String LOOKBACK = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.lookback";
public static final String DATETIME_FORMAT = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.format";
- private static final String ERROR_MESSAGE = LookbackPartitionFilterGenerator.class.getName()
- + " requires the following properties " + Arrays.toString(new String[]{PARTITION_COLUMN, LOOKBACK, DATETIME_FORMAT});
-
- private final String partitionColumn;
- private final Period lookback;
- private final DateTimeFormatter formatter;
+ private final Properties prop;
public LookbackPartitionFilterGenerator(Properties properties) {
- Preconditions.checkArgument(properties.containsKey(PARTITION_COLUMN), ERROR_MESSAGE);
- Preconditions.checkArgument(properties.containsKey(LOOKBACK), ERROR_MESSAGE);
- Preconditions.checkArgument(properties.containsKey(DATETIME_FORMAT), ERROR_MESSAGE);
-
- this.partitionColumn = properties.getProperty(PARTITION_COLUMN);
- this.lookback = Period.parse(properties.getProperty(LOOKBACK));
- this.formatter = DateTimeFormat.forPattern(properties.getProperty(DATETIME_FORMAT));
+ this.prop = (properties == null) ? System.getProperties(): properties;
}
@Override
public String getFilter(HiveDataset hiveDataset) {
- DateTime limitDate = (new DateTime()).minus(this.lookback);
+ if (isValidConfig()) {
Review comment:
I would prefer to throw an `IllegalArgumentException` like what Precondition check would do when the validation of configuration failed ( Keep the same behavior as it is right now)
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request
#2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
autumnust commented on a change in pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#discussion_r382313548
##########
File path: gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/source/HiveSource.java
##########
@@ -27,6 +27,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
+import org.apache.gobblin.data.management.copy.hive.PartitionFilterGenerator;
Review comment:
Please make sure you are following style guidance https://gobblin.readthedocs.io/en/latest/developer-guide/CodingStyle/
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request
#2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
autumnust commented on a change in pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#discussion_r385474038
##########
File path: gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/filter/LookbackPartitionFilterGenerator.java
##########
@@ -41,34 +40,44 @@
* must be such that lexycographical string and date ordering are compatible.
* </p>
*/
+@Slf4j
public class LookbackPartitionFilterGenerator implements PartitionFilterGenerator {
public static final String PARTITION_COLUMN = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.column";
public static final String LOOKBACK = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.lookback";
public static final String DATETIME_FORMAT = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.format";
- private static final String ERROR_MESSAGE = LookbackPartitionFilterGenerator.class.getName()
- + " requires the following properties " + Arrays.toString(new String[]{PARTITION_COLUMN, LOOKBACK, DATETIME_FORMAT});
-
- private final String partitionColumn;
- private final Period lookback;
- private final DateTimeFormatter formatter;
+ private final Properties prop;
public LookbackPartitionFilterGenerator(Properties properties) {
- Preconditions.checkArgument(properties.containsKey(PARTITION_COLUMN), ERROR_MESSAGE);
- Preconditions.checkArgument(properties.containsKey(LOOKBACK), ERROR_MESSAGE);
- Preconditions.checkArgument(properties.containsKey(DATETIME_FORMAT), ERROR_MESSAGE);
-
- this.partitionColumn = properties.getProperty(PARTITION_COLUMN);
- this.lookback = Period.parse(properties.getProperty(LOOKBACK));
- this.formatter = DateTimeFormat.forPattern(properties.getProperty(DATETIME_FORMAT));
+ this.prop = (properties == null) ? System.getProperties(): properties;
}
@Override
public String getFilter(HiveDataset hiveDataset) {
- DateTime limitDate = (new DateTime()).minus(this.lookback);
+ if (isValidConfig()) {
Review comment:
Sounds good to me.
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] KumaravelKandasami commented on a change in
pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition
filter extensible
Posted by GitBox <gi...@apache.org>.
KumaravelKandasami commented on a change in pull request #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#discussion_r383698568
##########
File path: gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/filter/LookbackPartitionFilterGenerator.java
##########
@@ -41,34 +40,44 @@
* must be such that lexycographical string and date ordering are compatible.
* </p>
*/
+@Slf4j
public class LookbackPartitionFilterGenerator implements PartitionFilterGenerator {
public static final String PARTITION_COLUMN = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.column";
public static final String LOOKBACK = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.lookback";
public static final String DATETIME_FORMAT = HiveDatasetFinder.HIVE_DATASET_PREFIX + ".partition.filter.datetime.format";
- private static final String ERROR_MESSAGE = LookbackPartitionFilterGenerator.class.getName()
- + " requires the following properties " + Arrays.toString(new String[]{PARTITION_COLUMN, LOOKBACK, DATETIME_FORMAT});
-
- private final String partitionColumn;
- private final Period lookback;
- private final DateTimeFormatter formatter;
+ private final Properties prop;
public LookbackPartitionFilterGenerator(Properties properties) {
- Preconditions.checkArgument(properties.containsKey(PARTITION_COLUMN), ERROR_MESSAGE);
Review comment:
Same ERROR_MESSAGE is printed when the validation is false in the getFilter() method.
<code>
log.error(LookbackPartitionFilterGenerator.class.getName()
+ " requires the following properties " + Arrays.toString(new String[]{PARTITION_COLUMN, LOOKBACK, DATETIME_FORMAT}));
<code>
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [incubator-gobblin] codecov-io edited a comment on issue #2894:
GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #2894: GOBBLIN-1054: Refactor HiveSource to make partition filter extensible
URL: https://github.com/apache/incubator-gobblin/pull/2894#issuecomment-587259006
# [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?src=pr&el=h1) Report
> Merging [#2894](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/166eb725c01c279068aaefa2c9af93c907bd9eff?src=pr&el=desc) will **decrease** coverage by `0.04%`.
> The diff coverage is `67.5%`.
[](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #2894 +/- ##
============================================
- Coverage 45.81% 45.77% -0.05%
- Complexity 9148 9160 +12
============================================
Files 1929 1933 +4
Lines 72602 72801 +199
Branches 7993 8026 +33
============================================
+ Hits 33264 33323 +59
- Misses 36303 36415 +112
- Partials 3035 3063 +28
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [.../management/conversion/hive/source/HiveSource.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvbnZlcnNpb24vaGl2ZS9zb3VyY2UvSGl2ZVNvdXJjZS5qYXZh) | `66.85% <100%> (+3.26%)` | `24 <0> (ø)` | :arrow_down: |
| [...hive/filter/DateRangePartitionFilterGenerator.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvaGl2ZS9maWx0ZXIvRGF0ZVJhbmdlUGFydGl0aW9uRmlsdGVyR2VuZXJhdG9yLmphdmE=) | `50% <50%> (ø)` | `4 <4> (?)` | |
| [.../hive/filter/LookbackPartitionFilterGenerator.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvaGl2ZS9maWx0ZXIvTG9va2JhY2tQYXJ0aXRpb25GaWx0ZXJHZW5lcmF0b3IuamF2YQ==) | `78.94% <76.47%> (-21.06%)` | `6 <5> (+3)` | |
| [...lin/util/filesystem/FileSystemInstrumentation.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvZmlsZXN5c3RlbS9GaWxlU3lzdGVtSW5zdHJ1bWVudGF0aW9uLmphdmE=) | `85.71% <0%> (-7.15%)` | `3% <0%> (ø)` | |
| [...in/java/org/apache/gobblin/cluster/HelixUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvSGVsaXhVdGlscy5qYXZh) | `38.26% <0%> (-4.22%)` | `14% <0%> (-1%)` | |
| [...org/apache/gobblin/runtime/api/FsSpecConsumer.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvYXBpL0ZzU3BlY0NvbnN1bWVyLmphdmE=) | `60% <0%> (-3.83%)` | `6% <0%> (+1%)` | |
| [...org/apache/gobblin/runtime/api/FsSpecProducer.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvYXBpL0ZzU3BlY1Byb2R1Y2VyLmphdmE=) | `72.54% <0%> (-3.07%)` | `9% <0%> (+1%)` | |
| [...gobblin/azkaban/AzkabanGobblinYarnAppLauncher.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1tb2R1bGVzL2dvYmJsaW4tYXprYWJhbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9hemthYmFuL0F6a2FiYW5Hb2JibGluWWFybkFwcExhdW5jaGVyLmphdmE=) | `30.55% <0%> (-2.78%)` | `2% <0%> (ø)` | |
| [...he/gobblin/writer/FineGrainedWatermarkTracker.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb3JlLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vd3JpdGVyL0ZpbmVHcmFpbmVkV2F0ZXJtYXJrVHJhY2tlci5qYXZh) | `82.25% <0%> (-2.42%)` | `28% <0%> (-1%)` | |
| [...anagement/copy/replication/ConfigBasedDataset.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvcmVwbGljYXRpb24vQ29uZmlnQmFzZWREYXRhc2V0LmphdmE=) | `68.87% <0%> (-1.68%)` | `10% <0%> (ø)` | |
| ... and [23 more](https://codecov.io/gh/apache/incubator-gobblin/pull/2894/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?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/incubator-gobblin/pull/2894?src=pr&el=footer). Last update [166eb72...dca6e66](https://codecov.io/gh/apache/incubator-gobblin/pull/2894?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
With regards,
Apache Git Services