Skip to content

Instantly share code, notes, and snippets.

@rbotzer
Created December 4, 2019 04:56
Show Gist options
  • Save rbotzer/acf99798656e582fa21feddb7de5598e to your computer and use it in GitHub Desktop.
Save rbotzer/acf99798656e582fa21feddb7de5598e to your computer and use it in GitHub Desktop.
Scan the entire dataset for a random sample
def print_sensor_data(rec, pp):
k, _, b = rec
print(k[2])
print(b['t'])
print("=" * 30)
print("\nScan for a random sampling (about 0.25%) of all the sensor data")
if options.interactive:
pause()
predexp = [
pxp.rec_digest_modulo(365),
pxp.integer_value(1),
pxp.integer_equal()
]
query = client.query(namespace, set)
query.predexp(predexp)
query.foreach(print_sensor_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment