Skip to content

Commit

Permalink
try suppress deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Oct 7, 2023
1 parent 390ff7a commit 404373c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ public void setup() {
records.add(new GenericRecordBuilder(schema).set("id", "3").set("body", "body13").build());
}

@SuppressWarnings("msg=deprecated")
@Test
public void createNewParquetFile()
throws InterruptedException, IOException, TimeoutException, ExecutionException {
// #init-writer

Configuration conf = new Configuration();
conf.setBoolean(AvroReadSupport.AVRO_COMPATIBILITY, true);
@SuppressWarnings("msg=deprecated")
ParquetWriter<GenericRecord> writer =
AvroParquetWriter.<GenericRecord>builder(new Path(file))
.withConf(conf)
Expand Down
2 changes: 1 addition & 1 deletion avroparquet/src/test/java/docs/javadsl/Examples.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public class Examples {
Source<GenericRecord, NotUsed> source = AvroParquetSource.create(reader);
// #init-source

@SuppressWarnings("msg=deprecated")
public Examples() throws IOException {

// #init-flow
@SuppressWarnings("msg=deprecated")
ParquetWriter<GenericRecord> writer =
AvroParquetWriter.<GenericRecord>builder(new Path("./test.parquet"))
.withConf(conf)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ trait AbstractAvroParquetBase {
val conf: Configuration = new Configuration()
conf.setBoolean(AvroReadSupport.AVRO_COMPATIBILITY, true)

@SuppressWarnings(Array("msg=deprecated"))
def parquetWriter[T <: GenericRecord](file: String, conf: Configuration, schema: Schema): ParquetWriter[T] =
AvroParquetWriter.builder[T](new Path(file)).withConf(conf).withSchema(schema).build()

Expand Down Expand Up @@ -80,6 +81,7 @@ trait AbstractAvroParquetBase {
// #prepare-source
}

@SuppressWarnings(Array("msg=deprecated"))
def sinkDocumentation(): Unit = {
// #prepare-sink
import com.sksamuel.avro4s.Record
Expand All @@ -97,6 +99,7 @@ trait AbstractAvroParquetBase {
}
}

@SuppressWarnings(Array("msg=deprecated"))
def initWriterDocumentation(): Unit = {
// #init-writer
import org.apache.avro.generic.GenericRecord
Expand Down

0 comments on commit 404373c

Please sign in to comment.