Author Archives: tobias

SQL Scratch

These are just scratches/notes for my work with Prestashop select id_product, reference from ps_product where reference like ‘9254050’ limit 10; Uppercase first letter only on string, and lowercase the others (remove any spaces infront or at the end)select name, concat(upper(left(name,1)),lower(substring(name,2,length(name)))) … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Functions as Arguments Java vs Scala, Game Set Match Scala Wins!

This is how you would create a function that takes a function as argument in Java The Function<A,B> myFunc = num -> “Value = ” + num;Here :A = the type of the first argument, in this example an intergerB … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Apache Cassandra Secondary Indices

How are Secondary Indices really stored ? This is based on the article from Datastax found here;¬† Let’s just create a simple table

Or visualized as a table : Column Type Key id int Primary Key city text name … Continue reading

Posted in Cassandra | 3 Comments

Print stacktraces for all threads on shutdown

If your microservice stops responding from time to time, and they only way out is to kill it with SIGINT or SIGTERM then adding a shutdown hook might be the way to go. Do note that this will not work … Continue reading

Posted in debugging, JAVA, JVM, Scala | 2 Comments

Apache Zeppelin, with Spark and Cassandra, the perfect tool

Zeppelin has become one of my favourite tools in my toolbox. I am heavily designing stuff for Cassandra and in Scala, and even though I love Cassandra there are times when things just gets so complicated with the CQL command … Continue reading

Posted in Uncategorized | 8 Comments

Remove the cardo-updater agent from OSX

I have the intercom from Cardo Systems, and it is really good BUT when I updated the firmware some time agoe, it decided to install some software that ¬†takes port 8080, which is one of those really common ports used … Continue reading

Posted in Mac, OSX, tool | 13 Comments

SQL LIKE operation in Cassandra, is possible in v3.4+

For a long time it has not been possible to do a SELECT * FROM table WHERE firstname like ‘t%’; in Cassandra like you could in eg.. MySQL or any other Relation Database for that matter. In Cassandra v3.4 this … Continue reading

Posted in Uncategorized | 3 Comments

UDF/User Defined Functions in Cassandra 3.x

I was just playing around with Cassandra WRITETIME and thought it was somewhat difficult to figure out the date / timestamp of a number like this (microseconds since EPOC) 1470645914253000. So in my example it looked like this

So … Continue reading

Posted in Cassandra, JAVA | 1 Comment

Cassandra set the writetime explicitly with a PreparedStatement

This is a quick one, I wanted to set the writetime of a row explicitly when I populate the database for testing purposes. We use the writetime of a column to filter them out. It required some looking around to … Continue reading

Posted in Cassandra, JAVA, Scala | 1 Comment

Apache SPARK and Cassandra and SQL

This is a short intro to start using Apache SPARK with Cassandra, running SQL on the Cassandra tables. Note that I am not running a SPARK cluster, I am running “local”, to me this is really convenient, not having to … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , | 2 Comments