[
https://issues.apache.org/jira/browse/GOBBLIN-1035?focusedWorklogId=380626&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-380626
]
ASF GitHub Bot logged work on GOBBLIN-1035:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 03/Feb/20 02:12
Start Date: 03/Feb/20 02:12
Worklog Time Spent: 10m
Work Description: arjun4084346 commented on pull request #2877:
[GOBBLIN-1035] make hive dataset descriptor accepts regexed db and tables
URL: https://github.com/apache/incubator-gobblin/pull/2877#discussion_r373897715
##########
File path:
gobblin-service/src/main/java/org/apache/gobblin/service/modules/dataset/HiveDatasetDescriptor.java
##########
@@ -65,16 +67,28 @@ public HiveDatasetDescriptor(Config config) throws
IOException {
partitionFormat = "";
conflictPolicy =
HiveCopyEntityHelper.ExistingEntityPolicy.REPLACE_TABLE.name();
}
+
+ whitelistBlacklist = new
WhitelistBlacklist(config.withValue(WhitelistBlacklist.WHITELIST,
+ ConfigValueFactory.fromAnyRef(createHiveDatasetWhitelist())));
this.setRawConfig(this.getRawConfig()
.withValue(CONFLICT_POLICY,
ConfigValueFactory.fromAnyRef(conflictPolicy))
.withValue(PARTITION_COLUMN,
ConfigValueFactory.fromAnyRef(partitionColumn))
.withValue(PARTITION_FORMAT,
ConfigValueFactory.fromAnyRef(partitionFormat))
- .withValue(WHITELIST_TABLES,
ConfigValueFactory.fromAnyRef(createWhitelistedTables())
+ .withValue(HiveDatasetFinder.HIVE_DATASET_PREFIX + "." +
WhitelistBlacklist.WHITELIST,
+ ConfigValueFactory.fromAnyRef(createHiveDatasetWhitelist())
));
}
- private String createWhitelistedTables() {
- return this.tableName.replace(',', '|');
+ // If the db name contains wildcards, whitelist is created as <regex_db>.*
+ // Otherwise, whitelist is created as <db>.tables.
+ // This is the format which HiveDatasetFinder understands.
+ // e.g. db=ei_tracking, table=zephyr*,abook*, whitelist will be
ei_tracking.zephyr*|abook*
+ String createHiveDatasetWhitelist() {
+ if (new GlobPattern(this.databaseName).hasWildcard()) {
Review comment:
I am using Hadoop's GlobPattern instead of java.util.regex, because I could
not find any API in java.util.regex which tells if the string is a plain string
or contains special characters. Do you know any API in java.util.regex? or
should I put this reason in comment?
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 380626)
Time Spent: 2h 10m (was: 2h)
> make hive dataset descriptor accepts regexed db and tables
> ----------------------------------------------------------
>
> Key: GOBBLIN-1035
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1035
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: Arjun Singh Bora
> Priority: Major
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)