this is a code snippet
- a list item
- another item
-- detect multiple auths in a short window and | |
-- send to lock account topic/microservice | |
SELECT card, | |
MAX(amount) as theamount, | |
TUMBLE_END(eventTimestamp, interval '5' minute) as ts | |
FROM payments | |
WHERE lat IS NOT NULL | |
AND lon IS NOT NULL | |
GROUP BY card, TUMBLE(eventTimestamp, interval '5' minute) | |
HAVING COUNT(*) > 4 -- >4==fraud |
-- new to my airspace | |
SELECT icao, pings FROM ( | |
SELECT icao, speed, | |
COUNT(*) OVER (PARTITION BY icao ORDER BY eventTimestamp RANGE BETWEEN INTERVAL '60' SECOND PRECEDING AND CURRENT ROW) AS pings | |
FROM airplanes | |
) WHERE pings < 5 | |
AND icao like 'A%' |
-- fraud processing on a stream of auths from a point of sale | |
SELECT card, | |
MAX(amount) as max_amount, | |
TUMBLE_END(eventTimestamp, interval '5' minute) as ts, | |
lat, | |
lon | |
FROM auth | |
GROUP BY card, TUMBLE(eventTimestamp, interval '5' minute) | |
HAVING COUNT(*) > 4 |
SELECT * FROM FOO ORDER BY 'baz' limit 9; |
SELECT * FROM FOO ORDER BY BAZ; | |
#!/usr/bin/env python | |
from __future__ import print_function | |
import json | |
import os | |
import random | |
import time | |
import sys | |
from kafka import KafkaProducer |
class ApacheFlink < Formula | |
desc "Scalable batch and stream data processing" | |
homepage "https://flink.apache.org/" | |
url "http://www.apache.org/dyn/closer.lua?path=/flink/flink-1.4.0/flink-1.4.0-bin-scala_2.11.tgz" | |
version "1.4.0" | |
sha256 "a6cee77e0719c42f0bd2d30e5a149a71ad50a708f163605c4570d418ba6c0035" | |
head "https://github.com/apache/flink.git" | |
bottle :unneeded |
def build_routes(): | |
""" return a geojson object with flight paths over last day """ | |
conn = database_connect() | |
cur = conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) | |
output = cur.execute( | |
""" | |
SELECT DISTINCT(tail) | |
AS tail | |
FROM planedemo_routes | |
WHERE lat != '' |
Jun 21 20:54:52 vapipeline01 kernel: [2239310.896998] Out of memory: Kill process 1056 (pipelinedb) score 506 or sacrifice child | |
Jun 21 20:54:52 vapipeline01 kernel: [2239310.903418] Killed process 1056 (pipelinedb) total-vm:12751636kB, anon-rss:8306604kB, file-rss:128kB | |
Jun 21 20:54:52 vapipeline01 pipeline[15284]: [342-1] LOG: autovacuum launcher process (PID 1056) was terminated by signal 9: Killed | |
Jun 21 20:54:52 vapipeline01 pipeline[15284]: [343-1] LOG: terminating any other active server processes | |
Jun 21 20:54:52 vapipeline01 pipeline[1060]: [295-1] WARNING: terminating connection because of crash of another server process | |
Jun 21 20:54:52 vapipeline01 pipeline[1191]: [294-1] WARNING: terminating connection because of crash of another server process | |
Jun 21 20:54:52 vapipeline01 pipeline[1059]: [310-1] WARNING: terminating connection because of crash of another server process | |
Jun 21 20:54:52 vapipeline01 pipeline[1162]: [294-1] WARNING: terminating connection because of crash of another server proc |