157 List<TDBInfo> dbs = client.get_databases(session);
159 for (TDBInfo db : dbs) {
160 logger.info(
"db is " + db.toString());
164 List<String>
tables = client.get_tables(session);
166 for (String tab : tables) {
167 logger.info(
"Tables is " + tab);
171 logger.info(
"Version " + client.get_version());
174 TTableDetails table_details = client.get_table_details(session,
"flights");
175 for (TColumnType col : table_details.row_desc) {
176 logger.info(
"col name :" + col.col_name);
177 logger.info(
"\tcol encoding :" + col.col_type.encoding);
178 logger.info(
"\tcol is_array :" + col.col_type.is_array);
179 logger.info(
"\tcol nullable :" + col.col_type.nullable);
184 logger.info(
" -- before query -- ");
186 TQueryResult sql_execute = client.sql_execute(session,
187 "Select uniquecarrier,flightnum from flights LIMIT 3;",
196 logger.info(
" -- after query -- ");
198 logger.info(
"TQueryResult execution time is " + sql_execute.getExecution_time_ms());
199 logger.info(
"TQueryResult is " + sql_execute.toString());
200 logger.info(
"TQueryResult getFieldValue is "
201 + sql_execute.getFieldValue(TQueryResult._Fields.ROW_SET));
203 TRowSet row_set = sql_execute.getRow_set();
204 Object fieldValue = sql_execute.getFieldValue(TQueryResult._Fields.ROW_SET);
206 logger.info(
"fieldValue " + fieldValue);
208 logger.info(
"TRowSet is " + row_set.toString());
210 logger.info(
"Get rows size " + row_set.getRowsSize());
211 logger.info(
"Get col size " + row_set.getRowsSize());
213 List<TRow>
rows = row_set.getRows();
215 for (TRow row :
rows) {
216 List<TDatum> cols = row.getCols();
218 for (TDatum dat : cols) {
219 logger.info(
"ROW " + count +
" " + dat.getFieldValue(TDatum._Fields.VAL));
225 List<TColumn> columns = row_set.getColumns();
227 logger.info(
"columns " + columns);
229 for (TColumn col : columns) {
230 TColumnData data = col.getData();
232 logger.info(
"COL " + count +
" " + data.toString());