def this()

in parquet/src/main/scala/magnolify/parquet/ParquetType.scala [169:192]


    def this() = this(null)

    override def init(context: hadoop.InitContext): hadoop.ReadSupport.ReadContext = {
      if (parquetType == null) {
        // Use deprecated getConfiguration
        // Recommended getParquetConfiguration is only available for parquet 1.14+
        val readKeyType = context.getConfiguration.get(ReadTypeKey): @nowarn("cat=deprecation")
        parquetType = SerializationUtils.fromBase64[ParquetType[T]](readKeyType)
      }

      val requestedSchema = {
        val s = Schema.message(parquetType.schema)
        // If reading Avro, roundtrip schema using parquet-avro converter to ensure array compatibility;
        // magnolify-parquet does not automatically wrap repeated fields into a group like parquet-avro does
        if (Schema.hasGroupedArray(context.getFileSchema)) {
          val converter = new AvroSchemaConverter()
          converter.convert(converter.convert(s))
        } else {
          s
        }
      }
      Schema.checkCompatibility(context.getFileSchema, requestedSchema)
      new hadoop.ReadSupport.ReadContext(requestedSchema, java.util.Collections.emptyMap())
    }