-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "compile summoned" TypeTag test case
- Loading branch information
Showing
10 changed files
with
225 additions
and
156 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
...les/core/src/test/scala-2.12/me/mnedokushev/zio/apache/parquet/core/filter/Fixtures.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,38 @@ | ||
package me.mnedokushev.zio.apache.parquet.core.filter | ||
|
||
import me.mnedokushev.zio.apache.parquet.core.Value | ||
import org.apache.parquet.filter2.predicate.FilterApi | ||
import org.apache.parquet.filter2.predicate.Operators.BinaryColumn | ||
import org.apache.parquet.io.api.Binary | ||
import zio.schema._ | ||
|
||
object Fixtures { | ||
|
||
case class MyRecord(a: String, b: Int, child: MyRecord.Child) | ||
|
||
object MyRecord { | ||
implicit val schema = DeriveSchema.gen[MyRecord] | ||
implicit val typeTag: TypeTag[MyRecord] = Derive.derive[TypeTag, MyRecord](TypeTagDeriver.default) | ||
|
||
case class Child(c: Int, d: Option[Long]) | ||
object Child { | ||
implicit val schema = DeriveSchema.gen[Child] | ||
implicit val typeTag: TypeTag[Child] = Derive.derive[TypeTag, Child](TypeTagDeriver.default) | ||
} | ||
|
||
} | ||
|
||
case class MyRecordSummoned(a: Int, b: String) | ||
|
||
object MyRecordSummoned { | ||
implicit val schema = DeriveSchema.gen[MyRecordSummoned] | ||
|
||
implicit val intTypeTag: TypeTag.EqNotEq[Int] = | ||
TypeTag.eqnoteq[Int, Binary, BinaryColumn]( | ||
FilterApi.binaryColumn, | ||
v => Value.string(v.toString).value | ||
) | ||
implicit val typeTag: TypeTag[MyRecordSummoned] = Derive.derive[TypeTag, MyRecordSummoned](TypeTagDeriver.summoned) | ||
} | ||
|
||
} |
18 changes: 0 additions & 18 deletions
18
...les/core/src/test/scala-2.12/me/mnedokushev/zio/apache/parquet/core/filter/MyRecord.scala
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
...les/core/src/test/scala-2.13/me/mnedokushev/zio/apache/parquet/core/filter/Fixtures.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,42 @@ | ||
package me.mnedokushev.zio.apache.parquet.core.filter | ||
|
||
import me.mnedokushev.zio.apache.parquet.core.Value | ||
import org.apache.parquet.filter2.predicate.FilterApi | ||
import org.apache.parquet.filter2.predicate.Operators.BinaryColumn | ||
import org.apache.parquet.io.api.Binary | ||
import zio.schema._ | ||
object Fixtures { | ||
|
||
case class MyRecord(a: String, b: Int, child: MyRecord.Child) | ||
|
||
object MyRecord { | ||
implicit val schema: Schema.CaseClass3.WithFields["a", "b", "child", String, Int, MyRecord.Child, MyRecord] = | ||
DeriveSchema.gen[MyRecord] | ||
implicit val typeTag: TypeTag[MyRecord] = | ||
Derive.derive[TypeTag, MyRecord](TypeTagDeriver.default) | ||
|
||
case class Child(c: Int, d: Option[Long]) | ||
object Child { | ||
implicit val schema: Schema.CaseClass2.WithFields["c", "d", Int, Option[Long], MyRecord.Child] = | ||
DeriveSchema.gen[Child] | ||
implicit val typeTag: TypeTag[Child] = | ||
Derive.derive[TypeTag, Child](TypeTagDeriver.default) | ||
|
||
} | ||
} | ||
|
||
case class MyRecordSummoned(a: Int, b: String) | ||
|
||
object MyRecordSummoned { | ||
implicit val schema: zio.schema.Schema.CaseClass2.WithFields["a", "b", Int, String, MyRecordSummoned] = | ||
DeriveSchema.gen[MyRecordSummoned] | ||
|
||
implicit val intTypeTag: TypeTag.EqNotEq[Int] = | ||
TypeTag.eqnoteq[Int, Binary, BinaryColumn]( | ||
FilterApi.binaryColumn, | ||
v => Value.string(v.toString).value | ||
) | ||
implicit val typeTag: TypeTag[MyRecordSummoned] = Derive.derive[TypeTag, MyRecordSummoned](TypeTagDeriver.summoned) | ||
} | ||
|
||
} |
26 changes: 0 additions & 26 deletions
26
...les/core/src/test/scala-2.13/me/mnedokushev/zio/apache/parquet/core/filter/MyRecord.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.