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



##########
File path: 
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/orc/HiveOrcSerDeManager.java
##########
@@ -75,12 +78,17 @@
   public static final String DEFAULT_SERDE_TYPE = "ORC";
   public static final String INPUT_FORMAT_CLASS_KEY = 
"hiveOrcSerdeManager.inputFormatClass";
   public static final String DEFAULT_INPUT_FORMAT_CLASS = 
OrcInputFormat.class.getName();
+  public static final String WRITER_LATEST_SCHEMA = "writer.latest.schema";
 
   public static final String OUTPUT_FORMAT_CLASS_KEY = 
"hiveOrcSerdeManager.outputFormatClass";
   public static final String DEFAULT_OUTPUT_FORMAT_CLASS = 
OrcOutputFormat.class.getName();
 
   public static final String HIVE_SPEC_SCHEMA_READING_TIMER = 
"hiveOrcSerdeManager.schemaReadTimer";
 
+  public static final String HIVE_SPEC_SCHEMA_FROM_WRITER = 
"hiveOrcSerdeManager.getSchemaFromWriterSchema";

Review comment:
       I see. We should probably not overload the writer schema configuration 
to mean different things in different scenarios. We can introduce a separate 
configuration for the GMCE use case. Thoughts?

##########
File path: 
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegistrationUnitComparator.java
##########
@@ -142,12 +146,24 @@ public T compareIsStoredAsSubDirs() {
     return (T) this;
   }
 
+  private State extractSchemaVersion(State state) {
+    State newState = new State(state);
+    String schemaFromState = 
state.getProp(AvroSerdeUtils.AvroTableProperties.SCHEMA_LITERAL.getPropName());
+    if (!Strings.isNullOrEmpty(schemaFromState)) {
+      String schemaVersion = AvroUtils.getSchemaCreationTime(new 
Schema.Parser().parse(schemaFromState));
+      if (!Strings.isNullOrEmpty(schemaVersion)) {
+         
newState.removeProp(AvroSerdeUtils.AvroTableProperties.SCHEMA_LITERAL.getPropName());
+         newState.setProp("schema.creationTime", schemaVersion);

Review comment:
       Can we define a static variable for this property? 




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