Skip to content

Commit

Permalink
Don't re-use Configuration objects in Parquet SMB (#4727)
Browse files Browse the repository at this point in the history
* Don't re-use Configuration objects in Parquet SMB

* make MiMa happy

* add type
  • Loading branch information
clairemcginty authored Mar 15, 2023
1 parent ae459d7 commit 52c611e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
*/
public class ParquetAvroFileOperations<ValueT> extends FileOperations<ValueT> {
static final CompressionCodecName DEFAULT_COMPRESSION = CompressionCodecName.GZIP;
static final Configuration DEFAULT_CONFIGURATION = new Configuration();

private final SerializableSchemaSupplier schemaSupplier;
private final CompressionCodecName compression;
private final SerializableConfiguration conf;
Expand All @@ -73,7 +71,7 @@ public static <V extends GenericRecord> ParquetAvroFileOperations<V> of(Schema s

public static <V extends GenericRecord> ParquetAvroFileOperations<V> of(
Schema schema, CompressionCodecName compression) {
return of(schema, compression, DEFAULT_CONFIGURATION);
return of(schema, compression, new Configuration());
}

public static <V extends GenericRecord> ParquetAvroFileOperations<V> of(
Expand All @@ -83,7 +81,7 @@ public static <V extends GenericRecord> ParquetAvroFileOperations<V> of(

public static <V extends GenericRecord> ParquetAvroFileOperations<V> of(
Schema schema, FilterPredicate predicate) {
return of(schema, predicate, DEFAULT_CONFIGURATION);
return of(schema, predicate, new Configuration());
}

public static <V extends GenericRecord> ParquetAvroFileOperations<V> of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ import java.nio.channels.{ReadableByteChannel, WritableByteChannel}

object ParquetTypeFileOperations {
val DefaultCompression = CompressionCodecName.GZIP
val DefaultConfiguration = new Configuration()
val DefaultConfiguration: Configuration = null

def apply[T: Coder: ParquetType](): ParquetTypeFileOperations[T] = apply(DefaultCompression)

def apply[T: Coder: ParquetType](
compression: CompressionCodecName
): ParquetTypeFileOperations[T] =
apply(compression, DefaultConfiguration)
apply(compression, new Configuration())

def apply[T: Coder: ParquetType](
compression: CompressionCodecName,
Expand All @@ -50,7 +50,7 @@ object ParquetTypeFileOperations {
ParquetTypeFileOperations(compression, new SerializableConfiguration(conf), null)

def apply[T: Coder: ParquetType](predicate: FilterPredicate): ParquetTypeFileOperations[T] =
apply(predicate, DefaultConfiguration)
apply(predicate, new Configuration())

def apply[T: Coder: ParquetType](
predicate: FilterPredicate,
Expand Down

0 comments on commit 52c611e

Please sign in to comment.