code: protected void addSchemaFromAvroFile(Schema schema, Path schemaFile, HiveRegistrationUnit hiveUnit)
        throws IOException {
      Preconditions.checkNotNull(schema);
  
      String schemaStr = schema.toString();
      if (schemaStr.length() <= this.schemaLiteralLengthLimit) {
        hiveUnit.setSerDeProp(SCHEMA_LITERAL, schema.toString());
      } else {
        Path schemaTempFile = null;
  
        if (useSchemaTempFile) {
          schemaTempFile = new Path(schemaFile.getParent(), this.schemaTempFileName);
        }
  
        AvroUtils.writeSchemaToFile(schema, schemaFile, schemaTempFile, this.fs, true);
        log.info("Using schema file " + schemaFile.toString());
        hiveUnit.setSerDeProp(SCHEMA_URL, schemaFile.toString());
      }
    }
docs: Add a {@link Schema} obtained from an Avro data file to the given {@link HiveRegistrationUnit}.
  
  <p>
  If the length of the schema is less than {@link #SCHEMA_LITERAL_LENGTH_LIMIT}, it will be added via
  {@link #SCHEMA_LITERAL}. Otherwise, the schema will be written to {@link #SCHEMA_FILE_NAME} and added
  via {@link #SCHEMA_URL}.
  </p>