SELECT { '*' | selectElement [, ...] } FROM [MAPPING] mapping_name [with_clause | with_index_clause]
selectElement:
expression [AS alias_name] | family_name ':' '*'
Returns the requested values for the given WITH or WITH INDEX clause
HConnection conn = HConnectionManager.newConnection();
conn.execute("CREATE TEMP MAPPING tab1 FOR TABLE table1"
+ "("
+ "keyval KEY, "
+ "f1 INCLUDE UNMAPPED ("
+ " val1 STRING ALIAS val1, "
+ " val2 INT ALIAS val5"
+ "), "
+ "f2 INCLUDE UNMAPPED, "
+ "f3 INCLUDE UNMAPPED ("
+ " val2 INT ALIAS val6, "
+ " val3 INT ALIAS val7 "
+ "))");
HPreparedStatement pstmt = conn.prepareStatement("SELECT keyval, f1:val1, val5 FROM tab1 "
+ "WITH KEYS FIRST TO :endkey "
+ "VERSIONS 4 "
+ "CLIENT FILTER WHERE val6 > 4");
pstmt.setParameter("endkey", Util.getZeroPaddedNonNegativeNumber(34, 10));
HResultSet<HRecord> records = pstmt.executeQuery();
for (HRecord record : records) {
System.out.println("Key = " + record.getCurrentValue("keyval"));
}
pstmt.close();