Skip to content

Instantly share code, notes, and snippets.

View kokosing's full-sized avatar
💤

Grzegorz Kokosiński kokosing

💤
View GitHub Profile
@kokosing
kokosing / release_issues.py
Created December 10, 2018 08:54
Create JIRA Releaase issues
#!/usr/bin/env python3
import argparse
import csv
import jira
parser = argparse.ArgumentParser(description='Create JIRA release epic branch issues.')
parser.add_argument('--file', metavar='file', type=str, help='Patches bookkeeping CSV file for releases')
parser.add_argument('--user', metavar='user', type=str, help='JIRA user')
@kokosing
kokosing / gist:605151723ecc2033f1ffd3b9d7adb140
Created December 2, 2018 21:17
ElasticsearchTableDescriptionProvider
commit 3c49cb3c86dd381ce331f19bcdbaa0b9f45afe66
Author: Grzegorz Kokosiński <grzegorz@starburstdata.com>
Date: Sun Dec 2 22:16:17 2018 +0100
ElasticsearchTableDescriptionProvider
diff --git a/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchClient.java b/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchClient.java
index 8c35fc9615..ed0b5adc29 100644
--- a/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchClient.java
+++ b/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchClient.java
@kokosing
kokosing / gist:42f3cbffa49ba0cd011eff1e7af85b6e
Created December 2, 2018 21:15
ElasticsearchTableDescriptionProvider
diff --git a/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchClient.java b/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchClient.java
index 8c35fc9615..ed0b5adc29 100644
--- a/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchClient.java
+++ b/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchClient.java
@@ -70,20 +70,19 @@ public class ElasticsearchClient
private static final Logger LOG = Logger.get(ElasticsearchClient.class);
private final ObjectMapper objecMapper = new ObjectMapperProvider().get();
- private final Map<SchemaTableName, ElasticsearchTableDescription> tableDescriptions;
+ private final ElasticsearchTableDescriptionProvider tableDescriptions;
commit d4d385b1593f42880c40a414319198304a429c24
Author: Grzegorz Kokosiński <grzegorz@starburstdata.com>
Date: Thu Dec 13 13:23:20 2018 +0100
Disable ranger
diff --git a/.travis.yml b/.travis.yml
index 56d10ab79e..0e6b5c4869 100644
--- a/.travis.yml
+++ b/.travis.yml
@kokosing
kokosing / presto_cli.sh
Last active July 2, 2018 07:39
presto_cli
#!/bin/bash
presto-product-tests/conf/docker/singlenode-kerberos-hdfs-impersonation/compose.sh run application-runner java -jar "/docker/volumes/presto-cli/presto-cli-executable.jar" --server https://presto-master.docker.cluster:7778 --keystore-path /docker/volumes/conf/presto/etc/docker.cluster.jks --keystore-password 123456 --enable-authentication --krb5-config-path /etc/krb5.conf --krb5-principal presto-client/presto-master.docker.cluster@LABS.TERADATA.COM --krb5-keytab-path /etc/presto/conf/presto-client.keytab --krb5-remote-service-name presto-server --krb5-disable-remote-service-hostname-canonicalization "${@}"
#./presto-product-tests/conf/docker/singlenode-kerberos-hdfs-impersonation/compose.sh run application-runner java -jar /docker/volumes/presto-cli/presto-cli-executable.jar --server presto-master:8080 "${@}"
@kokosing
kokosing / thread_dumps.sh
Created May 31, 2018 10:04
Parse thread dumps file
#!/bin/bash
set -exuo pipefail
# Usage <file with thread dumps> <output dir>
rm -rf $2
mkdir $2
cp $1 $2
@kokosing
kokosing / presto_trace.sh
Last active July 24, 2018 09:41
Trace Presto Server stack trace
#!/usr/bin/env bash
set -euo pipefail
ticks_to_collect=${1:-120}
presto_pids=$(sudo ps aux | grep PrestoServer | grep -v grep | awk '{ print $2 }')
for i in $(seq $ticks_to_collect); do
for presto_pid in $presto_pids; do
sudo kill -3 $presto_pid
@kokosing
kokosing / tables.sh
Last active June 19, 2018 10:18
Tables and schema population
#!/bin/bash
set -euo pipefail
schemas_count=500
tables_count=120
catalog=hive
echo "CREATE SCHEMA IF NOT EXISTS $catalog.schema_0;"
for s in `seq $schemas_count`; do
@kokosing
kokosing / odbc.c
Created March 21, 2018 09:22
Example odbc client
/**
* Author: Matt Fuller
*
* This is a basic test program I wrote while learning ODBC. It connects to a MySQL database I have running.
* I mostly followed the tutorial here:
* http://www.easysoft.com/developer/languages/c/odbc_tutorial.html
*/
#ifdef _WIN64
#include <windows.h>
#endif
@kokosing
kokosing / gist:219afbdc5a0315aa394a731b48156222
Created March 16, 2018 08:43
Testing tuple domain with decimal literal
diff --git a/presto-main/src/test/java/com/facebook/presto/sql/planner/TestDomainTranslator.java b/presto-main/src/test/java/com/facebook/presto/sql/planner/TestDomainTranslator.java
index 209c21ca22..8d6d00df1a 100644
--- a/presto-main/src/test/java/com/facebook/presto/sql/planner/TestDomainTranslator.java
+++ b/presto-main/src/test/java/com/facebook/presto/sql/planner/TestDomainTranslator.java
@@ -879,11 +879,31 @@ public class TestDomainTranslator
new InListExpression(ImmutableList.of(toExpression(1L, BIGINT)))),
withColumnDomains(ImmutableMap.of(C_SMALLINT, Domain.singleValue(SMALLINT, 1L))));
+ DecimalType decimalType_12_2 = createDecimalType(12, 2);
+ DecimalType decimalType_6_1= createDecimalType(6, 1);