Skip to content

Instantly share code, notes, and snippets.

View chaudum's full-sized avatar
🏠
Working from home

Christian Haudum chaudum

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python3
# vim: fileencoding=utf-8
from argparse import ArgumentParser
def setup(*args):
print(args)
$ curl -XPOST 'c01.demo.cratedb.cloud:4200/_flush?force=true&pretty'
{
"_shards" : {
"total" : 1820,
"successful" : 1820,
"failed" : 0
}
}
c01.demo.cratedb.cloud: Sep 11 06:03:56 c01.demo.cratedb.cloud crate[18917]: io.crate.exceptions.TableAliasSchemaException: Table alias "metrics" contains tables with different schema
c01.demo.cratedb.cloud: Sep 11 06:03:56 c01.demo.cratedb.cloud crate[18917]: at io.crate.metadata.doc.DocIndexMetaData.ensureEqual(DocIndexMetaData.java:650)
c01.demo.cratedb.cloud: Sep 11 06:03:56 c01.demo.cratedb.cloud crate[18917]: at io.crate.metadata.doc.DocTableInfoBuilder.docIndexMetaData(DocTableInfoBuilder.java:112)
c01.demo.cratedb.cloud: Sep 11 06:03:56 c01.demo.cratedb.cloud crate[18917]: at io.crate.metadata.doc.DocTableInfoBuilder.build(DocTableInfoBuilder.java:181)
c01.demo.cratedb.cloud: Sep 11 06:03:56 c01.demo.cratedb.cloud crate[18917]: at io.crate.metadata.doc.InternalDocTableInfoFactory.create(InternalDocTableInfoFactory.java:55)
c01.demo.cratedb.cloud: Sep 11 06:03:56 c01.demo.cratedb.cloud crate[18917]: at io.crate.metadata.doc.DocSchemaInfo.innerGetTableInfo(DocSchemaInfo.java:158)
c01.demo.cratedb.cloud:
@chaudum
chaudum / TsvImporter.java
Last active September 7, 2017 11:35
TSV Importer
package at.chaudum.tsvjdbc;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.sql.*;
import java.util.function.Consumer;
import java.util.stream.Stream;
public class TsvImporter {
christian@mac $ docker run -ti --rm -p 4200:4200 crate:2.1.5 crate -Ccluster.name=haudi -Cpath.home=/crate -Cnode.name=h1
Unable to find image 'crate:2.1.5' locally
2.1.5: Pulling from library/crate
019300c8a437: Already exists
4626b3670f77: Already exists
cb19096dde96: Already exists
36660792f216: Pull complete
396cdc59adea: Pull complete
ff7e07c6c2e1: Pull complete
51f0c97cefcf: Pull complete
/*
* Licensed to Crate under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership. Crate licenses this file
* to you under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may
* obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
" ~/.vimrc
" vim configuration for terminal
filetype off
execute pathogen#infect()
execute pathogen#helptags()
syntax on
color hybrid
[2017-08-01T08:58:35,224][ERROR][i.c.m.n.CrateNettyMqttHandler] Uncaught exception:
io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: invalid QoS: 3
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:422) ~[netty-codec-4.1.12.Final.jar:4.1.12.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) ~[netty-codec-4.1.12.Final.jar:4.1.12.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.12.Final.jar:4.1.12.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.12.Final.jar:4.1.12.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.12.Final.jar:4.1.12.Final]
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [netty-transport-4.1.1
drop table h.ft;
create analyzer tag_split (tokenizer split with (type='pattern', pattern='='), token_filters(lowercase));
create table h.ft (tags array(string), index tags_ft using fulltext(tags) with (analyzer='tag_split'));
insert into h.ft (tags) values (['zeit=a','zeit=b']);
insert into h.ft (tags) values (['rawr=a','rawr=b']);
insert into h.ft (tags) values (['zeit=a','rawr=b']);
select * from h.ft where tags_ft = 'zeit';
Jul 10 00:00:02 c02.mjd.cratedb.cloud crate[11761]: [2017-07-10T00:00:02,982][WARN ][o.e.d.i.m.TypeParsers ] Expected a boolean for property [index] but got [not_analyzed]
Jul 10 00:00:02 c02.mjd.cratedb.cloud crate[11761]: [2017-07-10T00:00:02,983][WARN ][o.e.d.i.m.StringFieldMapper$TypeParser] The [string] field is deprecated, please use [text] or [keyword] instead on [topic]
Jul 10 00:00:02 c02.mjd.cratedb.cloud crate[11761]: [2017-07-10T00:00:02,983][WARN ][o.e.d.i.m.TypeParsers ] Expected a boolean for property [index] but got [not_analyzed]
Jul 10 00:00:02 c02.mjd.cratedb.cloud crate[11761]: [2017-07-10T00:00:02,983][WARN ][o.e.d.i.m.TypeParsers ] Expected a boolean for property [index] but got [not_analyzed]
Jul 10 00:00:02 c02.mjd.cratedb.cloud crate[11761]: [2017-07-10T00:00:02,985][INFO ][o.e.a.a.i.c.TransportBulkCreateIndicesAction] [c02] [mqtt..partitioned.raw.04732d1p74r38d1o60o30c1g] creating index, cause [bulk], templates [mqtt..partitioned.raw., crate_defaults], shards [3]/[1], mappin