Skip to content

Instantly share code, notes, and snippets.

@tgruben
tgruben / build notes
Created September 17, 2012 20:52
Issue with Parent Child counting
curl -XPOST http://localhost:9200/parent_child --data-binary @mapping.json
curl -XPOST http://localhost:9200/_bulk --data-binary @bulk.json
curl -XPOST http://localhost:9200/parent_child/profile/_search -d'{"query":{"has_child": {"query": {"term": {"tag": 110475388978628}}, "type": "segment"}}}'
curl -XPOST http://localhost:9200/parent_child/profile/_count -d'{"query":{"has_child": {"query": {"term": {"tag": 110475388978628}}, "type": "segment"}}}'
@tgruben
tgruben / cass.go
Created October 16, 2014 16:01
Go Cassandra Test
package main
import (
"fmt"
"github.com/gocql/gocql"
"time"
)
type bm struct {
id int64
@tgruben
tgruben / cass.py
Created October 16, 2014 16:04
Python Cassandra Test
from cassandra.cluster import Cluster
cluster = Cluster()
session = cluster.connect('hotbox')
stmt = session.prepare('INSERT INTO bitmap ( bitmap_id, db, frame, slice , filter, ChunkKey, BlockIndex, block) VALUES (?,?,?,?,?,?,?,?);')
data=[(8192,'007','b.n',0,0,0,0,1),
(8192,'007','b.n',0,0,-1,0,1),
(8192,'007','b.n',0,0,0,0,3),
(8192,'007','b.n',0,0,-1,0,2),
(8192,'007','b.n',0,0,0,0,7),
@tgruben
tgruben / gist:840d1c34bfd38cfba671
Created October 16, 2014 18:46
Simpler Go script to reproduce loss ob sign bit
package main
import (
"fmt"
"github.com/gocql/gocql"
"time"
)
type bm struct {
id int64
@tgruben
tgruben / gist:e626a107428b91f5e491
Created October 16, 2014 19:02
Little more logging
package main
import (
"fmt"
"github.com/gocql/gocql"
"os"
"time"
)
type bm struct {
@tgruben
tgruben / gist:7b76a3e4757909ea5038
Created October 16, 2014 20:21
go issue ported to python
from cassandra.cluster import Cluster
cluster = Cluster()
session = cluster.connect('hotbox')
stmt = session.prepare('INSERT INTO bitmap2 ( bitmap_id, block) VALUES (?,?);')
session.execute('truncate bitmap2')
out = open("/tmp/cass_py","w")
for ids in range(32):
val=0
for i in range(0,64):
package main
import "fmt"
func takesString(str string) {}
func returnInterface(str string) interface{} {
return str
}
.
└── taxi
├── cab_type
│   └── views
│   └── standard
│   └── fragments
├── cost_cents
│   └── views
│   └── bsig_cost_cents
│   └── fragments
Script started on 2019-08-14 19:13:19+0000
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
]0;ubuntu@experiment-33bafd31037788eb: ~ubuntu@experiment-33bafd31037788eb:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 61870868 0 61870868 0% /dev
tmpfs 12376772 892 12375880 1% /run
/dev/sda1 9983232 1655520 8311328 17% /
tmpfs 61883856 0 61883856 0% /dev/shm
import org.apache.spark.sql.SparkSession
import org.apache.log4j.{Level, Logger}
object SimpleApp {
def main(args: Array[String]) {
Logger.getLogger("org.apache.spark").setLevel(Level.WARN)
val logFile = "/mnt/disks/data1/yellow_tripdata_2015-01.csv"
val spark = SparkSession.builder.appName("Simple Application").getOrCreate()