sv2000 commented on a change in pull request #3324:
URL: https://github.com/apache/gobblin/pull/3324#discussion_r660265157



##########
File path: 
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/orc/HiveOrcSerDeManager.java
##########
@@ -264,7 +272,18 @@ private void addSchemaProperties(Path path, 
HiveRegistrationUnit hiveUnit)
    *
    */
   protected void addSchemaPropertiesHelper(Path path, HiveRegistrationUnit 
hiveUnit) throws IOException {
-    TypeInfo schema = getSchemaFromLatestFile(path, this.fs);
+    TypeInfo schema;
+    if(props.getPropAsBoolean(HIVE_SPEC_SCHEMA_FROM_WRITER, 
DEFAULT_HIVE_SPEC_SCHEMA_FROM_WRITER)) {
+      try {
+        Preconditions.checkArgument(props.contains(WRITER_LATEST_SCHEMA));
+        Schema avroSchema = new 
Schema.Parser().parse(props.getProp(WRITER_LATEST_SCHEMA));
+        schema = TypeInfoUtils.getTypeInfoFromObjectInspector(new 
AvroObjectInspectorGenerator(avroSchema).getObjectInspector());

Review comment:
       Makes sense. Thanks for the explanation!




-- 
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