Skip to content

Instantly share code, notes, and snippets.

View nicosuave's full-sized avatar

Nico Ritschel nicosuave

View GitHub Profile
@nicosuave
nicosuave / sql_ls.py
Created January 25, 2025 22:10 — forked from z3z1ma/sql_ls.py
A simple language server implementation for SQLMesh using PyGLS
#!/usr/bin/env python
"""A Language Server Protocol (LSP) server for SQL with SQLMesh integration."""
import asyncio
import gc
import io
import logging
import re
import typing as t
import weakref
@nicosuave
nicosuave / request-body.json
Created November 3, 2024 19:10 — forked from ianmcook/request-body.json
Use the Snowflake SQL REST API from a shell script with curl and jq to execute a query and download the result partitions in Arrow format
{
"statement": "SELECT * FROM MYTABLE",
"resultSetMetaData": {
"format": "arrowv1"
},
"timeout": 60,
"database": "MYDATABASE",
"schema": "MYSCHEMA",
"warehouse": "MYWAREHOUSE",
"role": "MYROLE"
@nicosuave
nicosuave / Schema2CaseClass.scala
Created October 5, 2017 04:07 — forked from yoyama/Schema2CaseClass.scala
Generate case class from spark DataFrame/Dataset schema.
/**
* Generate Case class from DataFrame.schema
*
* val df:DataFrame = ...
*
* val s2cc = new Schema2CaseClass
* import s2cc.implicit._
*
* println(s2cc.schemaToCaseClass(df.schema, "MyClass"))
*
@nicosuave
nicosuave / 0_reuse_code.js
Created May 19, 2016 18:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console