Skip to content

Instantly share code, notes, and snippets.

View kokosing's full-sized avatar
💤

Grzegorz Kokosiński kokosing

💤
View GitHub Profile
@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 / migrate_changes.sh
Last active February 8, 2019 15:23
Migrate changes from prestodb/presto to prestosql/presto ~/misc/migrate_changes.sh
#!/usr/bin/env bash
set -euo pipefail
usage() {
echo "Usage: $0 <git change set>"
exit 1;
}
ask() {
@kokosing
kokosing / manual_merge.sh
Created February 7, 2019 21:22
manual_merge.sh
#!/usr/bin/env bash
set -xeuo pipefail
other_repo=~/presto-private
pushd "$other_repo"
files="$(git log --name-status -1 | grep '^[AM]\s' | awk '{print $2}')"
popd
for file in $files; do
#!/usr/bin/env bash
set -xeuo pipefail
usage()
{
echo "Usage: $0 -p <path of configs to be overriden>" >&2
exit 1
}
#!/usr/bin/env bash
################################################################################
# Copyright (c) 2018 Starburst Data, Inc. All rights reserved.
#
# All information herein is owned by Starburst Data Inc. and its licensors
# ("Starburst"), if any. This software and the concepts it embodies are
# proprietary to Starburst, are protected by trade secret and copyright law,
# and may be covered by patents in the U.S. and abroad. Distribution,
# reproduction, and relicensing are strictly forbidden without Starburst's prior