Skip to content

Instantly share code, notes, and snippets.

View Fokko's full-sized avatar
🚀

Fokko Driesprong Fokko

🚀
View GitHub Profile
*****************************************************
Summary
-------
Generated at: 2020-05-23T11:00:53+02:00
Notes: 3
Binaries: 0
Archives: 0
Standards: 31
@Fokko
Fokko / diff
Created November 17, 2019 20:15
$ colordiff -y <(xxd parquet-1-11-0.parquet) <(xxd parquet-1-10-1.parquet)
00000000: 5041 5231 1500 1514 1538 158b 8cf0 8805 PAR1.....8 | 00000000: 5041 5231 1500 1514 1538 2c15 0215 0015 PAR1.....8
00000010: 1c15 0215 0015 0615 0800 001f 8b08 0000 .......... | 00000010: 0615 081c 1804 0100 0000 1804 0100 0000 ..........
00000020: 0000 0000 0063 6260 6060 6664 0492 0030 .....cb``` | 00000020: 1600 2804 0100 0000 1804 0100 0000 0000 ..(.......
00000030: 8437 e40a 0000 0015 0015 1615 3a15 8fe7 .7........ | 00000030: 001f 8b08 0000 0000 0000 0063 6260 6060 ..........
00000040: 84fd 071c 1502 1500 1506 1508 0000 1f8b .......... | 00000040: 6664 0492 0030 8437 e40a 0000 0015 0015 fd...0.7..
00000050: 0800 0000 0000 0000 6362 6060 6066 6404 ........cb | 00000050: 1615 3a2c 1502 1500 1506 1508 1c18 0161 ..:,......
00000060: 9289 006b b98a ce0b 0000 0019 1102 1918 ...k...... | 00000060: 1801 6116 0028 0161 1801 6100 0000 1f8b ..a..(.a..
00000070: 0401 0000 0019 1804 0100 0000 1502 1916 .......... | 000

Read Delta Lake as plain Apache Parquet

Let's create a very simple Delta Lake table using three rows (3 people), and write it to the local disk /tmp/delta/:

Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
 /___/ .__/\_,_/_/ /_/\_\ version 2.4.4
version: "3.3"
services:
energy-monitor:
image: fokkodriesprong/youless-graphite-exporter
restart: always
links:
- graphite
environment:
- YOULESS_ADDRESS=192.168.1.111
- GRAPHITE_ADDRESS=192.168.1.123
curl -s http://192.168.1.111/a?f=j | \
jq .pwr -r | \
tr ',' '.' | \
xargs printf "watt_current:0|g\\watt_current:%s|g" | \
nc -w 1 -u graphite 8125
version: "3.3"
services:
energy-monitor-pwr:
image: fokkodriesprong/docker-alpine-cron
restart: always
links:
- graphite
environment:
- CRON_STRINGS=* * * * * curl -s http://192.168.1.111/a?f=j | jq .pwr -r | tr ',' '.' | xargs printf "watt_current:0|g\\watt_current:%s|g" | nc -w 1 -u graphite 8125
curl -s http://192.168.1.111/a?f=j | \
jq .pwr -r | \
tr ',' '.' | \
xargs printf "watt_current:0|g\\watt_current:%s|g" | \
nc -w 1 -u graphite 8125
$ curl -s http://192.168.1.111/a?f=j | jq
{
"cnt": " 19,909",
"pwr": -513,
"lvl": 0,
"dev": "",
"det": "",
"con": "",
"sts": "",
"cs0": " 0,000",
MacBook-Pro-van-Fokko:java fokkodriesprong$ docker run -t -i python:3.6 pip install apache-airflow[gcp_api]
Unable to find image 'python:3.6' locally
3.6: Pulling from library/python
5ae19949497e: Pull complete
ed3d96a2798e: Pull complete
f12136850781: Pull complete
1a9ad5d5550b: Pull complete
6f18049a0455: Pull complete
8daf83b35d32: Pull complete
c099d5e9ac68: Pull complete