Skip to content

Instantly share code, notes, and snippets.

David Phillips electrum

Block or report user

Report or block electrum

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git-release-changes.sh
#!/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 Jan 20, 2019
Presto SPI classes moved to connector package
View gist:bf90fe825140f3102b839b64694c39f5
BucketFunction
CatalogSchemaName
CatalogSchemaTableName
ColumnHandle
ColumnMetadata
ColumnNotFoundException
ConnectorHandleResolver
ConnectorIndex
ConnectorIndexHandle
ConnectorInsertTableHandle
@electrum
electrum / gist:d05be32d334773e022b7d3a8f7c5efad
Created Aug 29, 2018
Drift notes for unknown field preservation
View gist:d05be32d334773e022b7d3a8f7c5efad
@ThriftStruct
class Foo {
@ThriftId(2);
String foo;
@ThriftId(3)
ThriftString foo;
@ThriftUnknown
Map<Short, ThriftObject> unknown;
View gist:4ba3da9e7bbf0e47de1b2c2a3f71fed2
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;
View Batchable.java
package org.jdbi.v3.sqlobject;
/**
* A mixin interface to expose batching methods on the SQL object.
*/
public interface Batchable
{
/**
* Begin a SQL batch that will send multiple statements to the database
* at once. After this is called, a single
View GuiceLogger.java
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;
View travis-debug.sh
#!/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" \
View git-release-changes.sh
#!/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)
View ClassInitializer.java
public final class ClassInitializer
{
private final String name;
public ClassInitializer()
{
System.out.println(name);
}
{
@electrum
electrum / protocol.md
Last active Nov 14, 2017
Presto protocol enhancements
View protocol.md

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.

You can’t perform that action at this time.