Skip to content

Instantly share code, notes, and snippets.

View andelink's full-sized avatar
😶‍🌫️

Kyle Andelin andelink

😶‍🌫️
View GitHub Profile
@andelink
andelink / show-resolved-pr-comments.user.js
Created March 4, 2023 01:03
Show all resolved PR comments
// ==UserScript==
// @name Show all resolved PR comments
// @namespace http://tampermonkey.net/
// @version 0.3
// @description try to take over the world!
// @author You
// @match https://github.com/*/*/pull/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andelink
andelink / pyspark-sql-table-metadata.md
Created July 26, 2022 13:23
pyspark-sql-table-metadata.md

Describe table output:

>>> spark.sql('describe table extended test.sample').show(truncate=False, n=100)
+----------------------------+--------------------------------------------------------------+----------------------------+
|col_name                    |data_type                                                     |comment                     |
+----------------------------+--------------------------------------------------------------+----------------------------+
|some_id                     |bigint                                                        |some identifier column      |
|created_at                  |timestamp                                                     |when this record was created|
|status                      |string                                                        |status of this record       |
@andelink
andelink / script.py
Last active November 5, 2021 17:57
Haversine Distance Spark SQL
"""
https://gist.github.com/pavlov99/bd265be244f8a84e291e96c5656ceb5c
"""
from pyspark.sql import SparkSession
from pyspark.sql import functions as F
CITIES = [
('HKG', 'Hong Kong', 22.308919, 113.914603),
('SYD', 'Sydney', -33.946111, 151.177222),
('YYZ', 'Toronto', 43.677223, -79.630556),