NoSQL

Read the observations around P7’s fault

BOTIE

Connect history records and the complete bucket key to Select one complete partition key. Inspect which records remain before using time bounds.
Ready to test
0 passed · 0 failed · 2 not run

An empty floor. Start with the information your machine needs.

Received result

Your answer will arrive here.

Examples, experiments and workspace controls
Live values

Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.

Try your own inputs

Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.

Start at an output arrow, then click or drag to an input. Drag empty space to pan. Delete removes a selection. Ctrl/Cmd+Z undoes a change.
Context for this challenge

Connect history records and the complete bucket key to Select one complete partition key. Inspect which records remain before using time bounds.

The history contains several assets and daily buckets.

Inspect the component calculation
Select one complete partition key(
  Event records: History records
  Partition key record: Complete bucket key
)
Examples and results
History records
[
  {
    "id": "R3",
    "tenant": "north",
    "asset": "P7",
    "day": "d1",
    "time": 12
  },
  {
    "id": "R1",
    "tenant": "north",
    "asset": "P7",
    "day": "d1",
    "time": 10
  },
  {
    "id": "R2",
    "tenant": "north",
    "asset": "P8",
    "day": "d1",
    "time": 11
  },
  {
    "id": "R4",
    "tenant": "north",
    "asset": "P7",
    "day": "d2",
    "time": 14
  }
]
Complete bucket key
{
  "tenant": "north",
  "asset": "P7",
  "day": "d1"
}
Required result
[
  {
    "id": "R3",
    "tenant": "north",
    "asset": "P7",
    "day": "d1",
    "time": 12
  },
  {
    "id": "R1",
    "tenant": "north",
    "asset": "P7",
    "day": "d1",
    "time": 10
  }
]
History records
[
  {
    "id": "R3",
    "tenant": "north",
    "asset": "P7",
    "day": "d1",
    "time": 12
  },
  {
    "id": "R1",
    "tenant": "north",
    "asset": "P7",
    "day": "d1",
    "time": 10
  },
  {
    "id": "R2",
    "tenant": "north",
    "asset": "P8",
    "day": "d1",
    "time": 11
  },
  {
    "id": "R4",
    "tenant": "north",
    "asset": "P7",
    "day": "d2",
    "time": 14
  }
]
Complete bucket key
{
  "tenant": "north",
  "asset": "P7",
  "day": "d1"
}
Required result
[
  {
    "id": "R3",
    "tenant": "north",
    "asset": "P7",
    "day": "d1",
    "time": 12
  },
  {
    "id": "R1",
    "tenant": "north",
    "asset": "P7",
    "day": "d1",
    "time": 10
  }
]
Try a fresh construction

This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.

Stuck? Inspect a worked construction

The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.

Assumptions and test precision

This record-list calculation neither queries Cassandra nor measures its partition reads. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.

Two observations share the first timestamp

This check uses the pieces from “Find a bounded asset-history window”.

BOTIE

Select east’s P2 bucket d3 in the interval from twenty inclusive to twenty-three exclusive, limited to two IDs. A and B share time twenty-one, while C belongs to another bucket. Predict the ordered result.
History records
[
  {
    "id": "B",
    "tenant": "east",
    "asset": "P2",
    "day": "d3",
    "time": 21
  },
  {
    "id": "C",
    "tenant": "east",
    "asset": "P2",
    "day": "d4",
    "time": 20
  },
  {
    "id": "A",
    "tenant": "east",
    "asset": "P2",
    "day": "d3",
    "time": 21
  },
  {
    "id": "D",
    "tenant": "east",
    "asset": "P2",
    "day": "d3",
    "time": 23
  }
]
Complete bucket key
{
  "tenant": "east",
  "asset": "P2",
  "day": "d3"
}
Time interval
{
  "start": 20,
  "end": 23
}
Result limit
2

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

If the fault window crosses a day boundary, what additional bucket and merge work must the reader perform?

A complete answer requires every intersecting bucket and a consistent global event order.

This record-list calculation neither queries Cassandra nor measures its partition reads.

Work through the Python challenges →
Continue the courseWhy Did the Repair Disappear When Botie Read It Back? →
← Why Is One Storage Key Doing All the Work?