-
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.
- Loading branch information
Showing
10 changed files
with
138 additions
and
14 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
30 changes: 30 additions & 0 deletions
30
...sCoproduct/com/example/avrohugger/unions_with_coproduct_avsc2/UnionOfOneNonNullType.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,30 @@ | ||
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */ | ||
package com.example.avrohugger.unions_with_coproduct_avsc2 | ||
|
||
import scala.annotation.switch | ||
|
||
final case class UnionOfOneNonNullType(var f3: Map[String, String]) extends org.apache.avro.specific.SpecificRecordBase { | ||
def this() = this(Map.empty) | ||
def get(field$: Int): AnyRef = { | ||
(field$: @switch) match { | ||
case 0 => { | ||
f3 | ||
}.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 | ||
}.asInstanceOf[Map[String, String]] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
() | ||
} | ||
def getSchema: org.apache.avro.Schema = com.example.avrohugger.unions_with_coproduct_avsc2.UnionOfOneNonNullType.SCHEMA$ | ||
} | ||
|
||
object UnionOfOneNonNullType { | ||
val SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"UnionOfOneNonNullType\",\"namespace\":\"com.example.avrohugger.unions_with_coproduct_avsc2\",\"fields\":[{\"name\":\"f3\",\"type\":[{\"type\":\"map\",\"values\":\"string\"}]}]}") | ||
} |
30 changes: 30 additions & 0 deletions
30
...sCoproduct/com/example/avrohugger/unions_with_coproduct_avsc2/UnionOfOneNonNullType.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,30 @@ | ||
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */ | ||
package com.example.avrohugger.unions_with_coproduct_avsc2 | ||
|
||
import scala.annotation.switch | ||
|
||
final case class UnionOfOneNonNullType(var f3: Map[String, String]) extends org.apache.avro.specific.SpecificRecordBase { | ||
def this() = this(Map.empty) | ||
def get(field$: Int): AnyRef = { | ||
(field$: @switch) match { | ||
case 0 => { | ||
f3 | ||
}.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 | ||
}.asInstanceOf[Map[String, String]] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
() | ||
} | ||
def getSchema: org.apache.avro.Schema = com.example.avrohugger.unions_with_coproduct_avsc2.UnionOfOneNonNullType.SCHEMA$ | ||
} | ||
|
||
object UnionOfOneNonNullType { | ||
val SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"UnionOfOneNonNullType\",\"namespace\":\"com.example.avrohugger.unions_with_coproduct_avsc2\",\"fields\":[{\"name\":\"f3\",\"type\":[{\"type\":\"map\",\"values\":\"string\"}]}]}") | ||
} |
32 changes: 32 additions & 0 deletions
32
...sCoproduct/com/example/avrohugger/unions_with_coproduct_avsc2/UnionOfOneNonNullType.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 UnionOfOneNonNullType(var f3: Map[String, String] :+: CNil) extends org.apache.avro.specific.SpecificRecordBase { | ||
def this() = this(shapeless.Coproduct[Map[String, String] :+: CNil](Map.empty)) | ||
def get(field$: Int): AnyRef = { | ||
(field$: @switch) match { | ||
case 0 => { | ||
f3 | ||
}.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 | ||
}.asInstanceOf[Map[String, String] :+: CNil] | ||
case _ => new org.apache.avro.AvroRuntimeException("Bad index") | ||
} | ||
() | ||
} | ||
def getSchema: org.apache.avro.Schema = com.example.avrohugger.unions_with_coproduct_avsc2.UnionOfOneNonNullType.SCHEMA$ | ||
} | ||
|
||
object UnionOfOneNonNullType { | ||
val SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"UnionOfOneNonNullType\",\"namespace\":\"com.example.avrohugger.unions_with_coproduct_avsc2\",\"fields\":[{\"name\":\"f3\",\"type\":[{\"type\":\"map\",\"values\":\"string\"}]}]}") | ||
} |
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