Write my own small Promise

Having been using promise day to day in Angularjs / Nodejs, but never get a chance to look at the actual implement of it. Today I tried to write a simple version of Promise on my own. It turns out to be pretty interesting. 1st version – Basic classes(Promise and Deferred) First we need some…

JPA hibernate @GeneratedValue with sequence on Oracle

When using Oracle, the JPA with hibernate implementation on the @GeneratedValue with sequence would be quite tricky. I am trying to make a summary here. The version used are JPA 2.1 and Hibernate 4.3.11.Final Default generator setting @GeneratedValue with strategy AUTO and default allocationSize(50) This will use the ‘org.hibernate.id.SequenceGenerator’ which will get a SEQ+1 value….

Oracle partition table

We have an oracle table which used to use store proc to populate from other oracle table. Now since our upstream data source migrated to Hive, we need to do it thru jdbc and persist with JPA. And we hit a problem with: ‘inserted partition key does not map to any partition’. Turns out that…

Hive JDBC Architecture

Part 1: What is the actual contract that Hive provides us with? Hive’s contract to users is defined in the HiveInterface class That is – thrift is a communication channel that hive uses to expose its main service : which is the translation of SQL commands into hadoop / mapreduce commands.  The ultimate class invoked…

How JDBC URLs get mapped to connections at runtime

Who cares? I recently found the need to mock out a JDBC url to experiment with a new way of testing sqoop without a hard dependency on a particular database installation.  In order to do this, you first need to understand how it is that, at runtime, JDBC drivers connection call URLs get routed to implementation…