code: protected void addSchemaPropertiesHelper(Path path, HiveRegistrationUnit hiveUnit) throws IOException {
      TypeInfo schema = getSchemaFromLatestFile(path, this.fs);
      if (schema instanceof StructTypeInfo) {
        StructTypeInfo structTypeInfo = (StructTypeInfo) schema;
  
        hiveUnit.setSerDeProp(SCHEMA_LITERAL, schema);
        hiveUnit.setSerDeProp(serdeConstants.LIST_COLUMNS,
            Joiner.on(",").join(structTypeInfo.getAllStructFieldNames()));
        hiveUnit.setSerDeProp(serdeConstants.LIST_COLUMN_TYPES,
            Joiner.on(",").join(
                structTypeInfo.getAllStructFieldTypeInfos().stream().map(x -> x.getTypeName())
                    .collect(Collectors.toList())));
      } else {
        // Hive always uses a struct with a field for each of the top-level columns as the root object type.
        // So for here we assume to-be-registered ORC files follow this pattern.
        throw new IllegalStateException("A valid ORC schema should be an instance of struct");
      }
    }
docs: Extensible if there's other source-of-truth for fetching schema instead of interacting with HDFS.
  
  For purpose of initializing {@link org.apache.hadoop.hive.ql.io.orc.OrcSerde} object, it will require:
  org.apache.hadoop.hive.serde.serdeConstants#LIST_COLUMNS and
  org.apache.hadoop.hive.serde.serdeConstants#LIST_COLUMN_TYPES
  
  Keeping {@link #SCHEMA_LITERAL} will be a nice-to-have thing but not actually necessary in terms of functionality.