Skip to content

Instantly share code, notes, and snippets.

# git-new-workdirはgit-coreのcontribに入っているのでパスを通しておく
# $ ln -s ${git-core dir}/contrib/workdir/git-new-workdir /usr/local/bin
$ git-new-workdir fluentd fluentd-v11 v11
@choplin
choplin / map.sql
Last active December 20, 2015 17:39
CREATE OR REPLACE FUNCTION eval(_ anyelement, proc Text) RETURNS anyelement AS $$
BEGIN
EXECUTE 'SELECT ' || replace(proc, '_', _::text) INTO $0;
RETURN $0;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION map(ary anyarray, proc Text) RETURNS anyarray AS $SQL$
SELECT array_agg(eval(_, proc))
@choplin
choplin / gist:5361698
Created April 11, 2013 08:25
vim syntax for fluentd configuration
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
runtime! syntax/xml.vim
unlet b:current_syntax
[09/Apr/2013 11:40:04 +0000] hive_site CRITICAL Cannot understand remote metastore uri "thrift://{server1}:9083,thrift://{server2}:9083"
[09/Apr/2013 11:40:17 +0000] hive_site CRITICAL Cannot understand remote metastore uri "thrift://{server1}:9083,thrift://{server2}:9083"
[09/Apr/2013 11:42:46 +0000] supervisor ERROR Exception in supervisor main loop
Traceback (most recent call last):
File "/usr/share/hue/desktop/core/src/desktop/supervisor.py", line 379, in main
wait_loop(sups, options)
File "/usr/share/hue/desktop/core/src/desktop/supervisor.py", line 389, in wait_loop
time.sleep(1)
File "/usr/share/hue/desktop/core/src/desktop/supervisor.py", line 218, in sig_handler
raise SystemExit("Signal %d received. Exiting" % signum)
@choplin
choplin / gist:5292747
Created April 2, 2013 14:41
a bug of a predicate push down in hive
create table src_tbl (
key string,
value string
);
create table tbl_a (
key string,
value string
);
libraryDependencies += "org.apache.hbase" % "hbase" % "0.92.1-cdh4.1.1" % "provided"
@choplin
choplin / MessagePackWritable.scala
Last active December 12, 2015 04:08
型パラメータを使うとだめぽ
import java.io.{DataInput, DataOutput}
import org.apache.hadoop.io.{WritableComparable, WritableComparator}
import org.msgpack.ScalaMessagePack
trait MessagePackWritable extends WritableComparable[MessagePackWritable] {
type T
var instance:T
def get = instance
hive-0.9.0-cdh4.1.1/scripts
├── metastore
│   └── upgrade
│   ├── derby
│   │   ├── 001-HIVE-972.derby.sql
│   │   ├── 002-HIVE-1068.derby.sql
│   │   ├── 003-HIVE-675.derby.sql
│   │   ├── 004-HIVE-1364.derby.sql
│   │   ├── 005-HIVE-417.derby.sql
│   │   ├── 006-HIVE-1823.derby.sql
scala> import org.fluentd.logger.scala.FluentLoggerFactory
import org.fluentd.logger.scala.FluentLoggerFactory
scala> val l = FluentLoggerFactory.getLogger("debug")
l: org.fluentd.logger.scala.FluentLogger = org.fluentd.logger.FluentLogger{tagPrefix=debug,sender=localhost_24224_3000_1048576}
scala> l.log("hoge", Map("a" -> 1))
<console>:12: error: overloaded method value log with alternatives:
(label: String,data: scala.collection.immutable.Map[String,java.lang.Object])Boolean <and>
(label: String,data: scala.collection.mutable.Map[String,java.lang.Object])Boolean
@choplin
choplin / impala.rb
Created November 16, 2012 04:16
chef recipe for impala
yum_key "Impala-GPG-KEY" do
url "http://beta.cloudera.com/impala/redhat/6/x86_64/impala/RPM-GPG-KEY-cloudera"
action :add
end
yum_repository "Impala" do
url "http://beta.cloudera.com/impala/redhat/6/x86_64/impala/0/"
gpg "Impala-GPG-KEY"
action :add
end