Bubbles Operations
For Bubbles v0.1, June 2013Operation Arguments Description Signatures
Metadata operations
!
eld_
!
lterobj, keep, drop, renameFilters
!
elds of an object. Keep – keep only listed
!
elds, drop – keep all except
!
elds in the drop list, rename – new
!
eld names.
!
rows
!
sql
Row operations
!
lter_by_valueobj,
!
eld, valueGet rows where
!
eld is equal to value.
 !
rows
!
sql
!
lter_by_setobj,
!
eld, setGet rows where
!
eld is one of values from the set.
!
rows
!
lter_by_rangeobj,
!
eld, from, toGet rows where
!
eld is within given range.
 (not yet)
!
lter_by_predicateobj,
!
elds, predicateGet rows selected by the predicate. Predicate receives values for given
!
elds.
!
rows
!
records
distinctobj[, key]Distinct values for key
!
elds
 !
rows
!
sql
!
rst_uniqueobj[, key][,discard]Every
!
rst row with distinct value for key
!
elds
 !
rows
sampleobj, value[, mode]Provide a sample of objects rows based on mode. The mode might be:
!
rst, nth, random.
!
rows
!
sql
sortobj, orderReturns object with rows ordered based on order. Order is a list of tuples (
!
eld, order).
!
rows
!
sql
aggregateobj, keys, measures, include_countAggregate measures by keys
 !
rows
Field Operations
text_substituteobj,
!
eld, substitionsPerform substitutions (pattern, value) on
!
eld.
 !
rows
string_stripobj, [
!
elds, [chars]]Strip whitespaces (or chars) from
!
elds or all string and text
!
elds.
!
rows
append_constant_
!
eldsobj,
!
elds, valuesAppends
!
elds to the object with speci
!
ed constant values.
!
rows
!
sql
dates_to_dimensionobj, [
!
elds, [unknown_date]]Changes speci
!
ed
!
elds (or all date
!
elds) to a date dimension key in form
YYYYMMDD
. unknown_date value is used for empty date
!
elds.
!
rows
!
sql
data brewery
 Bubbles
 – operations
 Revision 1, June 2013, Bubbles 0.1 prototype
 
Operation Arguments Description Signatures
Compositions
appendobjects[]Append objects with same
!
elds
 !
rows
!
sql
 join_detailsmaster, detail, master_key, detail_keyComposes master and detail objects using left (inner) join by matching master_key
!
eld(s) with detail_key
!
eld(s).
!
rows,rows
!
sql,sql
added_keysdimension, source, dimension_key, source_keyGet keys that were added to the source if compared with dimension. Comparison is done on speci
!
ed keys.
!
sql,sql
added_rowsdimension, source, dimension_key, source_keyGet whole rows that were added to the source if compared with dimension. Comparison is done on speci
!
ed keys.
!
sql,sql
!
sql,rows
changed_rowsdimension, source, dimension_key, source_key,
!
elds, version_
!
eldGet rows that were changed in the source (
!
elds are compared for change). Row matching is done on speci
!
ed keys.
!
sql,sql
Auditing
distinct_countobj[,
!
elds]Count number of rows for distinct values of
!
elds (or all
!
elds)
!
sql
Assertions
assert_uniqueobj[, key]There should be no row (or key) duplicates in the object.
!
sql
Conversions
as_dictobj, key, valueConverts object to a python dictionary.
 !
rows
as_recordsobjReturn an object with records representation
 !
rows
!
sql
fetch_allobjFetches (consumes) all rows into a list and returns an object with rows representation.
!
rows
Output
pretty_printobj, targetProduces textual output to target (or stdout) formatted as table.
!
rows
Notes
!
All objects with
sql
 representation currently provide also
rows
 representation. The statements are executed (not necessarily fetched) and objects are handled as iterator objects. Therefore all
rows
 operations can be used.
data brewery
 Bubbles
 – operations
 Revision 1, June 2013, Bubbles 0.1 prototype
View on Scribd