Skip to content

Instantly share code, notes, and snippets.

View electrum's full-sized avatar
🚀
Working on @trinodb at @starburstdata

David Phillips electrum

🚀
Working on @trinodb at @starburstdata
View GitHub Profile
#!/bin/sh
set -eu
CURRENT=$1
git log --format='%<|(21)%cn %<|(39)%cd %<|(50)%h %s' --date=format-local:'%m-%d %H:%M:%S' $CURRENT.. | \
grep -vF '[maven-release-plugin]' | sort | \
awk '
{
@electrum
electrum / gist:bf90fe825140f3102b839b64694c39f5
Created January 20, 2019 06:22
Presto SPI classes moved to connector package
BucketFunction
CatalogSchemaName
CatalogSchemaTableName
ColumnHandle
ColumnMetadata
ColumnNotFoundException
ConnectorHandleResolver
ConnectorIndex
ConnectorIndexHandle
ConnectorInsertTableHandle
@electrum
electrum / gist:d05be32d334773e022b7d3a8f7c5efad
Created August 29, 2018 22:33
Drift notes for unknown field preservation
@ThriftStruct
class Foo {
@ThriftId(2);
String foo;
@ThriftId(3)
ThriftString foo;
@ThriftUnknown
Map<Short, ThriftObject> unknown;
package com.facebook.presto.sql.parser;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.atn.ATN;
import org.antlr.v4.runtime.atn.ATNState;
import org.antlr.v4.runtime.atn.NotSetTransition;
import org.antlr.v4.runtime.atn.Transition;
import org.antlr.v4.runtime.misc.IntervalSet;
import org.testng.annotations.Test;
@electrum
electrum / gist:5248077
Created March 26, 2013 18:51
IntelliJ IDEA add Jackson @JsonProperty constructor parameter annotations
(\w+) (\w+)([,)])
@JsonProperty("$2") $1 $2$3\n
@electrum
electrum / protocol.md
Last active November 14, 2017 15:59
Presto protocol enhancements

The current protocol uses HTTP headers for many things including session parameters, session properties, transaction info, prepared statements, etc. This is problematic for prepared statements due to length limitations on HTTP headers in various clients and servers. It is also makes the protocol harder to following by mixing things across headers and the request / response bodies.

As long as we're changing the protocol, it makes sense to move everything from headers into the JSON documents. We will add a new endpoint, /v2/statement, that accepts application/json with the new request body (instead of just the query text). The new endpoint will return the new response format.

package javatest8;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.matcher.Matchers;
import com.google.inject.spi.Dependency;
import com.google.inject.spi.DependencyAndSource;
#!/bin/sh -eu
job=$1
token=$(perl -ne '/access_token: (.*)/ && print $1' ~/.travis/config.yml)
curl -sS -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
#!/bin/sh -eu
CURRENT=$1
git log --format='%<|(21)%cn %<|(34)%ct %<|(48)%h %s' $CURRENT.. |
grep -vF '[maven-release-plugin]' | sort | cut -c1-21,34- |
awk '
{
if (NR > 1) {
name = substr($0, 1, 21)
public final class ClassInitializer
{
private final String name;
public ClassInitializer()
{
System.out.println(name);
}
{