Skip to content

Instantly share code, notes, and snippets.

@nenorbot
nenorbot / avro_null_generator.py
Created May 10, 2023 13:31
Generate an avro file with a single row containing all null values
import fastavro
schema = {
"type": "record",
"name": "topLevelRecord",
"fields": [
{"name": "string_col", "type": ["null", "string"], "default": None},
{"name": "int_col", "type": ["null", "int"], "default": None},
{"name": "bool_col", "type": ["null", "boolean"], "default": None},
{"name": "bigint_col", "type": ["null", "long"], "default": None},
def scan_leaf(leaf):
rowkey_prefix = leaf.app_id + '|' + leaf.event_date + '|' + leaf.event_type
filters = get_scan_filters(leaf.event_attributes)
scan_request = new_hbase_scan(table = 'events')
scan_request.set_rowkey_prefix(rowkey_prefix)
scan_request.set_filters(filters)
rows_result_set = scan_request.scan()
### Keybase proof
I hereby claim:
* I am nenorbot on github.
* I am nenorbot (https://keybase.io/nenorbot) on keybase.
* I have a public key whose fingerprint is 6DA4 4B5C 4AA1 3B63 B81F 20B3 A9EC 3864 4C92 B937
To claim this, I am signing this object:
@nenorbot
nenorbot / gist:e2f51ab9867ddf0ba4d0
Created June 30, 2015 06:21
reddit daily programmer challenge 221
(defn make-coords [word row row-inc col col-inc]
(map (fn [w row col] {:letter w :row row :col col})
word
(iterate #(+ % row-inc) row)
(iterate #(+ % col-inc) col)))
(defn make-next-direction [row col]
(println row col)
(let [modifier (if (= 0 (rand-int 2)) 1 -1)]
(cond