object AvroSchema
A set of constructors to generate Avro schema
- Alphabetic
- By Inheritance
- AvroSchema
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val FloatingPointPattern: Regex
-
def
apply(json: Json, name: String, namespace: Option[String]): Either[SAvroError, Schema]
Infer an Avro schema from a JSON object.
Infer an Avro schema from a JSON object. It only accepts an object or an array of objects. In any cases, the output is the Avro schema of a record. If the input is an array of objects, then generated schema will try to match with all the objects.
- def apply(json: String, name: String, namespace: Option[String]): Either[SAvroError, Schema]
- def apply(idl: String, namespace: String, recordName: String): Schema
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
inferArray(json: Json, name: String, namespace: Option[String]): Either[IllegalJsonInput, Schema]
Assuming that the input JSON is an array, it will take the first element and infers the schema as array of that type.
Assuming that the input JSON is an array, it will take the first element and infers the schema as array of that type. If the array is empty, it will return array of "null". If the value is not an array, it will return an error.
-
def
inferRecord(jsonObject: JsonObject, name: String, nameSpace: Option[String]): Either[IllegalJsonInput, Schema]
Tries to create the schema for the input JSON object as a RECORD.
Tries to create the schema for the input JSON object as a RECORD. First, it will sanitize the field names to be compatible with Avro standard. Then, creates the schema for each field value and accumulates them in one and returns it.
- jsonObject
the input JSON object
- name
the name of the object. It will makes sue that the first letter is capital
- nameSpace
an optional namespace to add to the record. If not provided, it will use empty string
- returns
the schema corresponding to the input JSON or an error if the input JSON is not an object ot it fails to infer the schema of any field
-
def
inferRecord(json: Json, name: String, nameSpace: Option[String]): Either[IllegalJsonInput, Schema]
Tries to create the schema for the input JSON object as a RECORD.
Tries to create the schema for the input JSON object as a RECORD. First, it will sanitize the field names to be compatible with Avro standard. Then, creates the schema for each field value and accumulates them in one and returns it.
- json
the input JSON object
- name
the name of the object. It will makes sue that the first letter is capital
- nameSpace
an optional namespace to add to the record. If not provided, it will use empty string
- returns
the schema corresponding to the input JSON or an error if the input JSON is not an object ot it fails to infer the schema of any field
-
def
inferRecordFromArray(jsonObjects: Vector[Json], name: String, namespace: Option[String]): Either[SAvroError, Schema]
Infer Avro schema from an array of JSON objects.
Infer Avro schema from an array of JSON objects. The final result should accept all the input objects normally using UNION and optional fields
- def inferSchema(json: Json, name: String, namespace: Option[String], isArrayItem: Boolean): Either[IllegalJsonInput, Schema]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mergeRecordSchema(left: Schema, right: Schema): Schema
Merges the fields of the right side into the fields of the left side.
Merges the fields of the right side into the fields of the left side. It will keep the union of the fields and makes sure the fields with the same name maintain compatible schema
- left
the base record
- right
the new record to be merged with the base record
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()