HMapping mapping = this.getMapping();
if (mapping == null) {
mapping = new HMappingDefaultImpl();
}
HBaseConnectionImpl connection = statement.getConnection();
String dbType = connection.getConnectProperties().getProperty("dbType");
Put put = null;
for (Map.Entry<String, SQLExpr> entry : columns.entrySet()) {
String column = entry.getKey();
SQLExpr valueExpr = entry.getValue();
Object value = SQLEvalVisitorUtils.eval(dbType, valueExpr, statement.getParameters());
if (value == null) {
continue;
}
byte[] bytes = mapping.toBytes(column, value);
if (mapping.isRow(column)) {
put = new Put(bytes);
} else {
byte[] family = mapping.getFamily(column);
byte[] qualifier = mapping.getQualifier(column);
put.add(family, qualifier, bytes);
}
}
HTableInterface htable = connection.getHTable(getTableName());
htable.put(put);
return false;
} catch (SQLException e) {
throw e;