-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support scala3 in avroparquet (#158)
* support scala3 in avroparquet add some scala3 tests Update AvroParquetSinkSpec.scala Update avroparquet.md Update AbstractAvroParquet.scala Update AbstractAvroParquet.scala * refactor test code * Update AbstractAvroParquetBase.scala * fix doc links * use Common.isScala3 * Update Dependencies.scala * Update build.sbt
- Loading branch information
Showing
10 changed files
with
108 additions
and
54 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
avroparquet/src/test/scala-2/docs/scaladsl/AbstractAvroParquet.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* license agreements; and to You under the Apache License, version 2.0: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* This file is part of the Apache Pekko project, derived from Akka. | ||
*/ | ||
|
||
/* | ||
* Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package docs.scaladsl | ||
|
||
import com.sksamuel.avro4s.RecordFormat | ||
import org.apache.pekko.testkit.TestKit | ||
import org.scalatest.{ BeforeAndAfterAll, Suite } | ||
|
||
import java.io.File | ||
import scala.reflect.io.Directory | ||
|
||
trait AbstractAvroParquet extends BeforeAndAfterAll with AbstractAvroParquetBase { | ||
this: Suite with TestKit => | ||
|
||
val format: RecordFormat[Document] = RecordFormat[Document] | ||
|
||
override def afterAll(): Unit = { | ||
TestKit.shutdownActorSystem(system) | ||
val directory = new Directory(new File(folder)) | ||
directory.deleteRecursively() | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
avroparquet/src/test/scala-3/docs/scaladsl/AbstractAvroParquet.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* license agreements; and to You under the Apache License, version 2.0: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* This file is part of the Apache Pekko project, derived from Akka. | ||
*/ | ||
|
||
/* | ||
* Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package docs.scaladsl | ||
|
||
import com.sksamuel.avro4s._ | ||
import org.apache.pekko.testkit.TestKit | ||
import org.scalatest.{ BeforeAndAfterAll, Suite } | ||
|
||
import java.io.File | ||
|
||
trait AbstractAvroParquet extends BeforeAndAfterAll with AbstractAvroParquetBase { | ||
this: Suite with TestKit => | ||
|
||
implicit val toRecordDocument: ToRecord[Document] = ToRecord[Document](schema) | ||
implicit val fromRecordDocument: FromRecord[Document] = FromRecord[Document](schema) | ||
val format: RecordFormat[Document] = RecordFormat[Document](schema) | ||
|
||
override def afterAll(): Unit = { | ||
TestKit.shutdownActorSystem(system) | ||
deleteRecursively(new File(folder)) | ||
} | ||
|
||
private def deleteRecursively(f: File): Boolean = { | ||
if (f.isDirectory) f.listFiles match { | ||
case null => | ||
case xs => xs.foreach(deleteRecursively) | ||
} | ||
f.delete() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters