final case classLeftShift[T[_[_]], A](src: A, struct: FreeMap[T], idStatus: IdStatus, repair: JoinFunc[T]) extends QScriptCore[T, A] with Product with Serializable
Flattens nested structure, converting each value into a data set, which are
then unioned.
struct is an expression that evaluates to an array or object, which is
then “exploded” into multiple values. idStatus indicates what each of
those exploded values should look like (either just the value, just the “id”
(i.e., the key or index), or a 2-element array of key and value). repair
is applied across the new set, integrating the exploded values into the
original set.
E.g., in:
LeftShift(x,
ProjectField(SrcHole, "bar"),
ExcludeId,
ConcatMaps(LeftSide, MakeMap("bar", RightSide)))
If x consists of things that look like { foo: 7, bar: [1, 2, 3] }, then
that’s what LeftSide is. And RightSide is values like 1, 2, and
3, because that’s what you get from flattening the struct.So then our
right-biased quasar.qscript.MapFuncs.ConcatMaps says to concat
{ foo: 7, bar: [1, 2, 3] } with { bar: 1 }, resulting in
{ foo: 7, bar: 1 } (then again with { foo: 7, bar: 2 } and
{ foo: 7, bar: 3 }, finishing up the handling of that one element in the
original (x) dataset.
Linear Supertypes
QScriptCore[T, A], Serializable, Serializable, Product, Equals, AnyRef, Any
Flattens nested structure, converting each value into a data set, which are then unioned.
struct
is an expression that evaluates to an array or object, which is then “exploded” into multiple values.idStatus
indicates what each of those exploded values should look like (either just the value, just the “id” (i.e., the key or index), or a 2-element array of key and value).repair
is applied across the new set, integrating the exploded values into the original set.E.g., in: LeftShift(x, ProjectField(SrcHole, "bar"), ExcludeId, ConcatMaps(LeftSide, MakeMap("bar", RightSide)))
{ foo: 7, bar: [1, 2, 3] }
consists of things that look likeIf
x, then that’s what LeftSide is. And RightSide is values like
1,
2, and
{ bar: 1 }3
, because that’s what you get from flattening the struct.So then our right-biased quasar.qscript.MapFuncs.ConcatMaps says to concat{ foo: 7, bar: [1, 2, 3] }
with, resulting in
{ foo: 7, bar: 2 }{ foo: 7, bar: 1 }
(then again withand
x{ foo: 7, bar: 3 }
, finishing up the handling of that one element in the original () dataset.