[ 
https://issues.apache.org/jira/browse/GOBBLIN-1035?focusedWorklogId=380607&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-380607
 ]

ASF GitHub Bot logged work on GOBBLIN-1035:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Feb/20 23:51
            Start Date: 02/Feb/20 23:51
    Worklog Time Spent: 10m 
      Work Description: sv2000 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_r373885919
 
 

 ##########
 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*
 
 Review comment:
   Can we remove these references?
 
----------------------------------------------------------------
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: 380607)
    Time Spent: 1h 50m  (was: 1h 40m)

> 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: 1h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to