ZihanLi58 commented on a change in pull request #3329:
URL: https://github.com/apache/gobblin/pull/3329#discussion_r669979234



##########
File path: 
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/writer/HiveMetadataWriter.java
##########
@@ -262,13 +264,34 @@ private void 
schemaUpdateHelper(GobblinMetadataChangeEvent gmce, HiveSpec spec,
           }
         }
       }
+    } else if 
(gmce.getRegistrationProperties().containsKey(HiveMetaStoreBasedRegister.SCHEMA_SOURCE_DB)
+        && 
!gmce.getRegistrationProperties().get(HiveMetaStoreBasedRegister.SCHEMA_SOURCE_DB).equals(spec.getTable().getDbName()))
 {
+      // If schema source is NONE and schema source db is set, we will 
directly update the schema to source db schema
+      String schemaSourceDb = 
gmce.getRegistrationProperties().get(HiveMetaStoreBasedRegister.SCHEMA_SOURCE_DB);
+      try {
+        String sourceSchema = fetchSchemaFromTable(schemaSourceDb, 
spec.getTable().getTableName());

Review comment:
       Update the code to try to use the existing schema map to get the schema. 
But if there is no schema in schema map, which means we don't register the 
source table and not maintain the latest schema, we will still fetch from hive 
to make sure we can always have the latest schema

##########
File path: 
gobblin-iceberg/src/test/java/org/apache/gobblin/iceberg/writer/HiveMetadataWriterTest.java
##########
@@ -278,9 +297,9 @@ public TestHiveRegistrationPolicy(State props) throws 
IOException {
       }
       return tables;
     }
-    protected Iterable<String> getDatabaseNames(Path path) {
+    /*protected Iterable<String> getDatabaseNames(Path path) {

Review comment:
       fixed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to