revelc / pyaccumulo

Python Client Library for Apache Accumulo
Apache License 2.0
26 stars 23 forks source link

Scanning sample ranges for preview #27

Open dtabacco opened 7 years ago

dtabacco commented 7 years ago

I looked through the scanner options and I couldn't figure out a way to just ask accumulo to scan the "first 10 rows" of a table. I am trying to create a preview mode for a table, assuming the user has no knowledge of the key design. The scan ranges seem to imply I need to already know and provide a key range.

Is there a better way to do this?

jatrost commented 7 years ago

Try this

conn.scan(table)[:5]

Or

itertools.islice(conn.scan(table), 0, 4)