Releases: bullet-db/bullet-record
Log4j provided and only Slf4j
We now only have a compile time dependency on slf4j-api
. The binding to log4j is marked as provided so dependent projects can use whatever logging implementation they want. If log4j is desired, then those projects can depend on the binding and mark it as as scope compile
.
Type hinting
This release adds these new interfaces to BulletRecord"
- A new
BulletRecord#typedGet(String, Type)
abstract method is added BulletRecord#typedGet(String)
is no longer abstract and callsBulletRecord#typedGet(String, Type)
withType#UNKNOWN
.- The various map and list accessing
typedGet
methods now also have a hint parameter - All subclasses can now implement
typedGet(String, Type)
This change lets us optimize getting data out of the record when we know the type for sure.
Unknowns as first class and support for deeper types
This release changes:
- The
TypedObject(Type, Serializable)
constructor now figures out the type if the passed in type wasType#UNKNOWN
- The behavior of Type discovery in
Type#getType(Object)
is changed. For container of containers (e.g.INTEGER_MAP_LIST
orSTRING_MAP_MAP
), the discovered type can now beUNKNOWN_MAP
,UNKNOWN_LIST
,UNKNOWN_MAP_MAP
,UNKNOWN_MAP_LIST
in many more cases. Previously, this code looked for the first type that we support in these containers. Now, unless all the types in the container match this one type, the corresponding UNKNOWN container type is returned instead. This also has the behavior that maps inside containers whose types can't be discovered (if they're empty or only contain null values) cause the entire collection to discovered as the UNKNOWN container type. This differs from before where the discovery would skip these objects whose type can't be discovered and seek for the first valid one.
These two changes basically make UNKNOWN containers usable in Bullet. The use-case for this is sticking objects into a BulletRecord that nest deeper than the types we support. Bullet itself will recognize them appropriately as UNKNOWN_MAP_MAP
or UNKNOWN_MAP_LIST
and will let you extract fields up to the level we do recognize. If those extracted fields are types we support, then Bullet can still operate on them! The change in 1 above causes these extracted UNKNOWNs to have their Type discovered and fix itself.
This change will affect both TypedBulletRecord
and UntypedBulletRecord
as BulletRecord#typedGet
will now discover types for UNKNOWN containers
LazyBulletAvro does not force a SerDe cycle when copy constructing
The LazyBulletAvro copy constructor invoked in the Avro Bullet Record copy method forced the target LazyBulletAvro to serialize and deserialize itself. While this effectively deep-copied, this is inefficient in Bullet when a base record is copied per query. This change makes the LazyBulletAvro force deserialize the source and shallow copy the map instead.
Exposes LazyBulletAvro interfaces to stick in other Avros
This release exposes the SerDes in LazyBulletAvro so a subclass can plug in its own Avro instead of a BulletAvro. The relevant constructors to use a new LazyBulletAvro have also been added to UntypedAvroBulletRecord and TypedAvroBulletRecord.
First release using Screwdriver
No new changes
First release on Maven Central - Bintray EOL
No changes to source - minor Javadoc cleanup
Ternary Logic
This release adds ternary logic support and changes the return type for containsKey, containsValue, compareTo, equalTo in TypedObject to be the boxed types.
- TypedObject no longer implements Comparable since TypedObject#compareTo returns Integer instead of an int to be able return NULL
- TypedObject#equalTo now returns a Boolean to return NULL
- Type#canCompare now returns false if either Type is Type.NULL
- TypedObject#containsKey now returns Boolean and returns true if the key was found as before. It returns NULL if the key was not found within the type but null was (or if a nested MAP itself was null). It returns false otherwise.
- TypedObject#containsValue now returns Boolean and returns true if the value was found as before. It returns NULL if the value was not found but null was. It returns false otherwise.
First Major Release - TypeSystem, Typed Bullet Records, Schemas and more!
This marks the first major release of Bullet Record as part of the full Expression rewrite.
-
It moves and fully revamps the TypeSystem.java and Type.java from bullet-db/bullet-core to bullet-record since typing is now fundamental in Bullet and supporting typing in the Bullet Record is necessary. The types themselves have been extended to support the all container types with subtypes (such as INTEGER_MAP, DOUBLE_MAP_MAP or INTEGER_MAP_LIST). Casting is supported in full with safe casting and force casting available separately. The TypedObject has also been extended to support the Types better with better comparators and many many other utility functions.
-
The Avro and Simple Bullet Records have now been moved into their own packages
com.yahoo.bullet.record.avro
andcom.yahoo.bullet.record.simple
respectively. New Typed versions of these have been added that natively support types. -
There are numerous changes to BulletRecord
3.1 It is now serializable
3.2 We provide two flavors called TypedBulletRecord and UntypedBulletRecord. Both records work with types but the untyped one will need to figure out types at run-time, which would be a performance drop.
3.3 The recommended way to add and remove objects from the BulletRecord is to use typedSet and typedGet, although most of the older set methods are still supported.
3.4. New utility methods such as copy or making a read-only view of the data are added -
Schema support has been added with full support for the new type system. This will serve as the basis for type-checking in BQL and used in the API for serving schemas.
More sets in BulletRecord
This release provides more set methods in BulletRecord:
set(String, BulletRecord, String, int, String)
set(String, BulletRecord, String, String, String)
forceSet(String, Object)
The first two now allow you to copy an item from a Map inside a List or a Map inside a Map in another BulletRecord. The forceSet
method now allows you to set whatever you want in a BulletRecord without regard for type safety (previously, barring type erasure, had let you write clean BulletRecord insert operations). You can use this method now to set anything as long as your record implementation allows it or if you know the type of the object but can't be bothered to cast or figure out which of the exact correct types it is.