Skip to content

Instantly share code, notes, and snippets.

View kokosing's full-sized avatar
💤

Grzegorz Kokosiński kokosing

💤
View GitHub Profile
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 / 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
#!/usr/bin/env bash
set -xeuo pipefail
usage()
{
echo "Usage: $0 -p <path of configs to be overriden>" >&2
exit 1
}
@kokosing
kokosing / gist:d85ab9a5bfbb3d555f4cf8388b7896fd
Last active February 13, 2020 07:11
Group logs by thread
while read line; do
thread=$(echo $line | awk '{ if (NF > 3) { print $3; } else {print "other";} print 'y';}');
echo $line >> $thread;
done < ../modified.logs
io.prestosql.spi.PrestoException: Error committing write to Hive
at io.prestosql.plugin.hive.OrcFileWriter.commit(OrcFileWriter.java:153)
at io.prestosql.plugin.hive.HiveWriter.commit(HiveWriter.java:86)
at io.prestosql.plugin.hive.HivePageSink.doFinish(HivePageSink.java:193)
at io.prestosql.plugin.hive.authentication.NoHdfsAuthentication.doAs(NoHdfsAuthentication.java:23)
at io.prestosql.plugin.hive.HdfsEnvironment.doAs(HdfsEnvironment.java:80)
at io.prestosql.plugin.hive.HivePageSink.finish(HivePageSink.java:184)
at io.prestosql.spi.connector.classloader.ClassLoaderSafeConnectorPageSink.finish(ClassLoaderSafeConnectorPageSink.java:74)
at io.prestosql.operator.TableWriterOperator.finish(TableWriterOperator.java:193)
at io.prestosql.operator.Driver.processInternal(Driver.java:397)
hive> create table x(c_bigint BIGINT, c_varchar VARCHAR(255)) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES ("separatorCh
ar" = "S", "quoteChar" = "Q", "escapeChar" = "E") STORED AS TEXTFILE TBLPROPERTIES ("separatorChar" = "s", "quoteChar" = "q", "escapeChar" = "e");
OK
Time taken: 0.655 seconds
hive> insert into x values (1, 'dwa');
OK
Time taken: 18.714 seconds
hive>
hive> show create table x;
OK
diff --git a/pom.xml b/pom.xml
index 0ea686e..60dddc9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,21 +5,18 @@
<parent>
<artifactId>presto-root</artifactId>
<groupId>io.prestosql</groupId>
- <version>302-e.11</version>
- <relativePath>../../repos/presto</relativePath>
@kokosing
kokosing / gist:41a958909b20262cba1c667ac0840fb5
Last active June 5, 2019 08:36
Output of: presto-cli/target/presto-cli-314-SNAPSHOT-executable.jar --server http://127.0.0.1:52280 --execute 'select * from jmx.current."iprestosql.plugin.jdbc:name=postgresql,type=jdbcclient";' --output-format JSON | jq .
{
"abortreadconnection.failures.fifteenminute.count": 0,
"abortreadconnection.failures.fifteenminute.rate": 0,
"abortreadconnection.failures.fiveminute.count": 0,
"abortreadconnection.failures.fiveminute.rate": 0,
"abortreadconnection.failures.oneminute.count": 0,
"abortreadconnection.failures.oneminute.rate": 0,
"abortreadconnection.failures.totalcount": 0,
"abortreadconnection.time.alltime.avg": 0.002544151589242054,
"abortreadconnection.time.alltime.count": 409,
{
"abortreadconnection.failures.fifteenminute.count": 0,
"abortreadconnection.failures.fifteenminute.rate": 0,
"abortreadconnection.failures.fiveminute.count": 0,
"abortreadconnection.failures.fiveminute.rate": 0,
"abortreadconnection.failures.oneminute.count": 0,
"abortreadconnection.failures.oneminute.rate": 0,
"abortreadconnection.failures.totalcount": 0,
"abortreadconnection.time.alltime.avg": 0.002544151589242054,
"abortreadconnection.time.alltime.count": 409,
@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')