-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'LeonPoon-bug-using-either-for-coproduct-v1.5.3'
- Loading branch information
Showing
25 changed files
with
655 additions
and
28 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
[ | ||
{ | ||
"namespace": "com.example.avrohugger.unions_with_coproduct_avsc2", | ||
"name": "UnionOfNullWithOneNonNullType", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "f3", | ||
"type": [ | ||
"null", | ||
"double" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"namespace": "com.example.avrohugger.unions_with_coproduct_avsc2", | ||
"name": "UnionOfTwoNonNullTypes", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "r4", | ||
"type": [ | ||
"int", | ||
"string" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"namespace": "com.example.avrohugger.unions_with_coproduct_avsc2", | ||
"name": "UnionOfNullWithTwoNonNullTypes", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "r5", | ||
"type": [ | ||
"null", | ||
"int", | ||
"string" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"namespace": "com.example.avrohugger.unions_with_coproduct_avsc2", | ||
"name": "UnionOfMoreThanTwoNonNullTypes", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "r6", | ||
"type": [ | ||
"boolean", | ||
"int", | ||
"string" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"namespace": "com.example.avrohugger.unions_with_coproduct_avsc2", | ||
"name": "UnionOfNullWithMoreThanTwoNonNullTypes", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "r7", | ||
"type": [ | ||
"null", | ||
"boolean", | ||
"int", | ||
"string" | ||
] | ||
} | ||
] | ||
} | ||
] |
32 changes: 32 additions & 0 deletions
32
...t/com/example/avrohugger/unions_with_coproduct_avsc2/UnionOfMoreThanTwoNonNullTypes.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,32 @@ | ||
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */ | ||
package com.example.avrohugger.unions_with_coproduct_avsc2 | ||
|
||
import scala.annotation.switch | ||
|
||
import shapeless.{:+:, CNil, Coproduct} | ||
|
||
final case class UnionOfMoreThanTwoNonNullTypes(var r6: Boolean :+: Int :+: String :+: CNil) extends org.apache.avro.specific.SpecificRecordBase { | ||
def this() = this(shapeless.Coproduct[Boolean :+: Int :+: String :+: CNil](false)) | ||
def get(field$: Int): AnyRef = { | ||
(field$: @switch) match { | ||
case 0 => { | ||
r6 | ||
}.asInstanceOf[AnyRef] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
} | ||
def put(field$: Int, value: Any): Unit = { | ||
(field$: @switch) match { | ||
case 0 => this.r6 = { | ||
value | ||
}.asInstanceOf[Boolean :+: Int :+: String :+: CNil] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
() | ||
} | ||
def getSchema: org.apache.avro.Schema = com.example.avrohugger.unions_with_coproduct_avsc2.UnionOfMoreThanTwoNonNullTypes.SCHEMA$ | ||
} | ||
|
||
object UnionOfMoreThanTwoNonNullTypes { | ||
val SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"UnionOfMoreThanTwoNonNullTypes\",\"namespace\":\"com.example.avrohugger.unions_with_coproduct_avsc2\",\"fields\":[{\"name\":\"r6\",\"type\":[\"boolean\",\"int\",\"string\"]}]}") | ||
} |
38 changes: 38 additions & 0 deletions
38
...ample/avrohugger/unions_with_coproduct_avsc2/UnionOfNullWithMoreThanTwoNonNullTypes.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 @@ | ||
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */ | ||
package com.example.avrohugger.unions_with_coproduct_avsc2 | ||
|
||
import scala.annotation.switch | ||
|
||
import shapeless.{:+:, CNil} | ||
|
||
final case class UnionOfNullWithMoreThanTwoNonNullTypes(var r7: Option[Boolean :+: Int :+: String :+: CNil]) extends org.apache.avro.specific.SpecificRecordBase { | ||
def this() = this(None) | ||
def get(field$: Int): AnyRef = { | ||
(field$: @switch) match { | ||
case 0 => { | ||
r7 match { | ||
case Some(x) => x | ||
case None => null | ||
} | ||
}.asInstanceOf[AnyRef] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
} | ||
def put(field$: Int, value: Any): Unit = { | ||
(field$: @switch) match { | ||
case 0 => this.r7 = { | ||
value match { | ||
case null => None | ||
case _ => Some(value) | ||
} | ||
}.asInstanceOf[Option[Boolean :+: Int :+: String :+: CNil]] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
() | ||
} | ||
def getSchema: org.apache.avro.Schema = com.example.avrohugger.unions_with_coproduct_avsc2.UnionOfNullWithMoreThanTwoNonNullTypes.SCHEMA$ | ||
} | ||
|
||
object UnionOfNullWithMoreThanTwoNonNullTypes { | ||
val SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"UnionOfNullWithMoreThanTwoNonNullTypes\",\"namespace\":\"com.example.avrohugger.unions_with_coproduct_avsc2\",\"fields\":[{\"name\":\"r7\",\"type\":[\"null\",\"boolean\",\"int\",\"string\"]}]}") | ||
} |
36 changes: 36 additions & 0 deletions
36
...ct/com/example/avrohugger/unions_with_coproduct_avsc2/UnionOfNullWithOneNonNullType.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,36 @@ | ||
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */ | ||
package com.example.avrohugger.unions_with_coproduct_avsc2 | ||
|
||
import scala.annotation.switch | ||
|
||
final case class UnionOfNullWithOneNonNullType(var f3: Option[Double]) extends org.apache.avro.specific.SpecificRecordBase { | ||
def this() = this(None) | ||
def get(field$: Int): AnyRef = { | ||
(field$: @switch) match { | ||
case 0 => { | ||
f3 match { | ||
case Some(x) => x | ||
case None => null | ||
} | ||
}.asInstanceOf[AnyRef] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
} | ||
def put(field$: Int, value: Any): Unit = { | ||
(field$: @switch) match { | ||
case 0 => this.f3 = { | ||
value match { | ||
case null => None | ||
case _ => Some(value) | ||
} | ||
}.asInstanceOf[Option[Double]] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
() | ||
} | ||
def getSchema: org.apache.avro.Schema = com.example.avrohugger.unions_with_coproduct_avsc2.UnionOfNullWithOneNonNullType.SCHEMA$ | ||
} | ||
|
||
object UnionOfNullWithOneNonNullType { | ||
val SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"UnionOfNullWithOneNonNullType\",\"namespace\":\"com.example.avrohugger.unions_with_coproduct_avsc2\",\"fields\":[{\"name\":\"f3\",\"type\":[\"null\",\"double\"]}]}") | ||
} |
Oops, something went wrong.