i had create a index.
String indexDdl = "CREATE INDEX if not exists "+tableName+"_idx ON " + tableName + "(int_column) ";
the index value in hbase is :
hbase(main):003:0> scan 'TEST4_IDX'
ROW COLUMN+CELL
\xC1\x02\x00varchar1\x00char1 column=_0:_0, timestamp=1388646353386, value=
1 row(s) in 0.0120 seconds
version : newest 3.0.0 build with trunk code
create table ddl : String ddl = "create table if not exists " + tableName + "("
upsert : String upsert = "UPSERT INTO " + tableName + " (varchar_pk,char_pk,int_column) VALUES (?, ?, ?)"; PreparedStatement prepareStmt = conn.prepareStatement(upsert); prepareStmt.setString(1, "varchar1"); prepareStmt.setString(2, "char1"); prepareStmt.setInt(3, 1); prepareStmt.executeUpdate();
select :
String query = "SELECT * FROM " + tableName; ResultSet rs = conn.createStatement().executeQuery(query); System.out.println(rs.getString(1)); System.out.println(rs.getString(2)); System.out.println(rs.getInt(3));
but the print is archar1 char1 1090650230
i'm so sorry. a important thing I did't point out
i had create a index. String indexDdl = "CREATE INDEX if not exists "+tableName+"_idx ON " + tableName + "(int_column) ";
the index value in hbase is : hbase(main):003:0> scan 'TEST4_IDX' ROW COLUMN+CELL \xC1\x02\x00varchar1\x00char1 column=_0:_0, timestamp=1388646353386, value= 1 row(s) in 0.0120 seconds