16 package ai.heavy.jdbc;
18 import org.apache.thrift.TException;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
22 import java.sql.Connection;
23 import java.sql.DatabaseMetaData;
24 import java.sql.ResultSet;
25 import java.sql.RowIdLifetime;
26 import java.sql.SQLException;
29 import ai.heavy.thrift.server.TColumn;
30 import ai.heavy.thrift.server.TColumnData;
31 import ai.heavy.thrift.server.TColumnType;
32 import ai.heavy.thrift.server.TDBInfo;
33 import ai.heavy.thrift.server.TDBObject;
34 import ai.heavy.thrift.server.TDBObjectType;
35 import ai.heavy.thrift.server.TDatumType;
36 import ai.heavy.thrift.server.TEncodingType;
37 import ai.heavy.thrift.server.TQueryResult;
38 import ai.heavy.thrift.server.TRowSet;
39 import ai.heavy.thrift.server.TTableDetails;
40 import ai.heavy.thrift.server.TTablePermissions;
41 import ai.heavy.thrift.server.TTypeInfo;
45 LoggerFactory.getLogger(HeavyAIDatabaseMetaData.class);
53 this.con = connection;
57 }
catch (TException ex) {
58 throw new SQLException(
"Failed to get DB version " + ex.toString());
60 String vers[] = databaseVersion.split(
"\\.");
64 }
catch (NumberFormatException ex) {
65 throw new SQLException(
66 "Non-numeric version returned from HEAVY.AI server: " + ex.getMessage());
72 HEAVYDBLOGGER.debug(
"Entered");
78 HEAVYDBLOGGER.debug(
"Entered");
83 public String
getURL() throws SQLException {
84 HEAVYDBLOGGER.debug(
"Entered");
90 HEAVYDBLOGGER.debug(
"Entered");
96 HEAVYDBLOGGER.debug(
"Entered");
102 HEAVYDBLOGGER.debug(
"Entered");
108 HEAVYDBLOGGER.debug(
"Entered");
114 HEAVYDBLOGGER.debug(
"Entered");
120 HEAVYDBLOGGER.debug(
"Entered");
126 HEAVYDBLOGGER.debug(
"Entered");
132 throws SQLException {
133 HEAVYDBLOGGER.debug(
"Entered");
134 return this.databaseVersion;
139 HEAVYDBLOGGER.debug(
"Entered");
140 return "OmniSciDB JDBC Driver";
145 HEAVYDBLOGGER.debug(
"Entered");
161 HEAVYDBLOGGER.debug(
"Entered");
167 HEAVYDBLOGGER.debug(
"Entered");
173 HEAVYDBLOGGER.debug(
"Entered");
179 HEAVYDBLOGGER.debug(
"Entered");
185 HEAVYDBLOGGER.debug(
"Entered");
191 HEAVYDBLOGGER.debug(
"Entered");
197 HEAVYDBLOGGER.debug(
"Entered");
203 HEAVYDBLOGGER.debug(
"Entered");
209 HEAVYDBLOGGER.debug(
"Entered");
215 HEAVYDBLOGGER.debug(
"Entered");
221 HEAVYDBLOGGER.debug(
"Entered");
227 HEAVYDBLOGGER.debug(
"Entered");
233 HEAVYDBLOGGER.debug(
"Entered");
234 return "ACOS(float), ACOS(number), ASIN, ATAN2, CEIL, COS, COT, DEGREES, EXP, FLOOR, LN, LOG, PI(), POWER, SQRT"
235 +
", RADIANS, ROUND, SIN, TAN, ATAN, ABS, MOD SIGN, TRUNCATE";
240 HEAVYDBLOGGER.debug(
"Entered");
241 return "CHAR_LENGTH, CHAR, KEY_FOR_STRING";
246 HEAVYDBLOGGER.debug(
"Entered");
252 HEAVYDBLOGGER.debug(
"Entered");
254 return "DATE_TRUNC, NOW, EXTRACT";
259 HEAVYDBLOGGER.debug(
"Entered");
265 HEAVYDBLOGGER.debug(
"Entered");
271 HEAVYDBLOGGER.debug(
"Entered");
277 HEAVYDBLOGGER.debug(
"Entered");
283 HEAVYDBLOGGER.debug(
"Entered");
289 HEAVYDBLOGGER.debug(
"Entered");
295 HEAVYDBLOGGER.debug(
"Entered");
301 HEAVYDBLOGGER.debug(
"Entered");
307 HEAVYDBLOGGER.debug(
"Entered");
313 HEAVYDBLOGGER.debug(
"Entered");
319 HEAVYDBLOGGER.debug(
"Entered");
325 HEAVYDBLOGGER.debug(
"Entered");
331 HEAVYDBLOGGER.debug(
"Entered");
337 HEAVYDBLOGGER.debug(
"Entered");
343 HEAVYDBLOGGER.debug(
"Entered");
349 HEAVYDBLOGGER.debug(
"Entered");
355 HEAVYDBLOGGER.debug(
"Entered");
361 HEAVYDBLOGGER.debug(
"Entered");
367 HEAVYDBLOGGER.debug(
"Entered");
373 HEAVYDBLOGGER.debug(
"Entered");
379 HEAVYDBLOGGER.debug(
"Entered");
385 HEAVYDBLOGGER.debug(
"Entered");
391 HEAVYDBLOGGER.debug(
"Entered");
397 HEAVYDBLOGGER.debug(
"Entered");
403 HEAVYDBLOGGER.debug(
"Entered");
409 HEAVYDBLOGGER.debug(
"Entered");
415 HEAVYDBLOGGER.debug(
"Entered");
421 HEAVYDBLOGGER.debug(
"Entered");
427 HEAVYDBLOGGER.debug(
"Entered");
433 HEAVYDBLOGGER.debug(
"Entered");
439 HEAVYDBLOGGER.debug(
"Entered");
445 HEAVYDBLOGGER.debug(
"Entered");
451 HEAVYDBLOGGER.debug(
"Entered");
457 HEAVYDBLOGGER.debug(
"Entered");
463 HEAVYDBLOGGER.debug(
"Entered");
469 HEAVYDBLOGGER.debug(
"Entered");
475 HEAVYDBLOGGER.debug(
"Entered");
481 HEAVYDBLOGGER.debug(
"Entered");
487 HEAVYDBLOGGER.debug(
"Entered");
493 HEAVYDBLOGGER.debug(
"Entered");
499 HEAVYDBLOGGER.debug(
"Entered");
505 HEAVYDBLOGGER.debug(
"Entered");
511 HEAVYDBLOGGER.debug(
"Entered");
517 HEAVYDBLOGGER.debug(
"Entered");
523 HEAVYDBLOGGER.debug(
"Entered");
529 HEAVYDBLOGGER.debug(
"Entered");
535 HEAVYDBLOGGER.debug(
"Entered");
541 HEAVYDBLOGGER.debug(
"Entered");
547 HEAVYDBLOGGER.debug(
"Entered");
553 HEAVYDBLOGGER.debug(
"Entered");
559 HEAVYDBLOGGER.debug(
"Entered");
565 HEAVYDBLOGGER.debug(
"Entered");
571 HEAVYDBLOGGER.debug(
"Entered");
577 HEAVYDBLOGGER.debug(
"Entered");
583 HEAVYDBLOGGER.debug(
"Entered");
589 HEAVYDBLOGGER.debug(
"Entered");
595 HEAVYDBLOGGER.debug(
"Entered");
601 HEAVYDBLOGGER.debug(
"Entered");
607 HEAVYDBLOGGER.debug(
"Entered");
613 HEAVYDBLOGGER.debug(
"Entered");
619 HEAVYDBLOGGER.debug(
"Entered");
625 HEAVYDBLOGGER.debug(
"Entered");
631 HEAVYDBLOGGER.debug(
"Entered");
637 HEAVYDBLOGGER.debug(
"Entered");
643 HEAVYDBLOGGER.debug(
"Entered");
649 HEAVYDBLOGGER.debug(
"Entered");
655 HEAVYDBLOGGER.debug(
"Entered");
661 HEAVYDBLOGGER.debug(
"Entered");
667 HEAVYDBLOGGER.debug(
"Entered");
673 HEAVYDBLOGGER.debug(
"Entered");
679 HEAVYDBLOGGER.debug(
"Entered");
685 HEAVYDBLOGGER.debug(
"Entered");
691 HEAVYDBLOGGER.debug(
"Entered");
697 HEAVYDBLOGGER.debug(
"Entered");
703 HEAVYDBLOGGER.debug(
"Entered");
709 HEAVYDBLOGGER.debug(
"Entered");
715 HEAVYDBLOGGER.debug(
"Entered");
721 HEAVYDBLOGGER.debug(
"Entered");
727 HEAVYDBLOGGER.debug(
"Entered");
733 HEAVYDBLOGGER.debug(
"Entered");
739 HEAVYDBLOGGER.debug(
"Entered");
740 return Connection.TRANSACTION_NONE;
745 HEAVYDBLOGGER.debug(
"Entered");
751 HEAVYDBLOGGER.debug(
"Entered");
757 throws SQLException {
758 HEAVYDBLOGGER.debug(
"Entered");
764 HEAVYDBLOGGER.debug(
"Entered");
770 HEAVYDBLOGGER.debug(
"Entered");
776 HEAVYDBLOGGER.debug(
"Entered");
782 String catalog, String schemaPattern, String procedureNamePattern)
783 throws SQLException {
784 HEAVYDBLOGGER.debug(
"Entered");
795 String schemaPattern,
796 String procedureNamePattern,
797 String columnNamePattern)
throws SQLException {
798 HEAVYDBLOGGER.debug(
"Entered");
799 throw new UnsupportedOperationException(
"Not supported yet,"
800 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
801 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
802 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
814 TColumnType ct =
new TColumnType();
815 ct.col_name = colName;
816 ct.col_type = colType;
817 ct.is_reserved_keyword = irk;
818 ct.is_system =
false;
819 ct.is_physical =
false;
870 String catalog, String schemaPattern, String tableNamePattern, String[] types)
871 throws SQLException {
872 HEAVYDBLOGGER.debug(
"Entered");
876 tables = con.client.get_tables_for_database(con.session, catalog);
877 }
catch (TException ex) {
878 throw new SQLException(
"get_tables_for_database failed " + ex.toString());
883 views = con.client.get_views(con.session);
884 }
catch (TException ex) {
885 throw new SQLException(
"get_views failed " + ex.toString());
889 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
901 Map<String, ArrayList<String>> dataMap =
new HashMap(columns.length);
902 Map<String, ArrayList<Boolean>> nullMap =
new HashMap(columns.length);
906 List<TColumnType> rowDesc =
new ArrayList(columns.length);
907 for (TColumnType col : columns) {
909 dataMap.put(col.col_name,
new ArrayList());
910 nullMap.put(col.col_name,
new ArrayList());
912 if (schemaPattern == null
913 || schemaPattern.toLowerCase().equals(con.getCatalog().toLowerCase())) {
915 for (String x : tables) {
916 dataMap.get(
"TABLE_NAME").add(x);
917 nullMap.get(
"TABLE_NAME").add(
false);
918 nullMap.get(
"TABLE_SCHEM").add(
true);
919 nullMap.get(
"TABLE_CAT").add(
true);
920 if (views.contains(x) ==
true) {
921 dataMap.get(
"TABLE_TYPE").add(
"VIEW");
923 dataMap.get(
"TABLE_TYPE").add(
"TABLE");
925 nullMap.get(
"TABLE_TYPE").add(
false);
926 nullMap.get(
"REMARKS").add(
true);
927 nullMap.get(
"TYPE_CAT").add(
true);
928 nullMap.get(
"TYPE_SCHEM").add(
true);
929 nullMap.get(
"TYPE_NAME").add(
true);
930 nullMap.get(
"SELF_REFERENCING_COL_NAME").add(
true);
931 nullMap.get(
"REF_GENERATION").add(
true);
934 List<TColumn> columnsList =
new ArrayList(columns.length);
936 for (TColumnType col : columns) {
939 columnsList.add(schemaCol);
943 TRowSet rowSet =
new TRowSet(rowDesc, null, columnsList,
true);
945 TQueryResult
result =
new TQueryResult(
946 rowSet, 0, 0, null, null,
true, ai.heavy.thrift.server.TQueryType.UNKNOWN);
954 TColumnData colData =
new TColumnData();
955 colData.setStr_col((List<String>) data);
957 TColumn col =
new TColumn(colData, nullsList);
963 HEAVYDBLOGGER.debug(
"Entered");
965 List<TDBInfo> databases = null;
968 databases = con.client.get_databases(con.session);
969 }
catch (TException ex) {
970 throw new SQLException(
"get_database failed " + ex.toString());
976 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
977 TColumnType columns[] = {
createTColumnType(
"TABLE_SCHEM",
new TTypeInfo(strTTI)),
980 List<TColumnType> rowDesc =
new ArrayList();
981 for (TColumnType col : columns) {
986 List<String> schemaList =
new ArrayList();
987 List<Boolean> nullList =
new ArrayList();
988 List<Boolean> catalogNullList =
new ArrayList();
990 for (TDBInfo x : databases) {
991 schemaList.add(x.db_name);
993 catalogNullList.add(
true);
996 TColumnData colData =
new TColumnData();
997 colData.setStr_col(schemaList);
999 TColumn schemaCol =
new TColumn(colData, nullList);
1000 TColumn catalogCol =
new TColumn(null, catalogNullList);
1002 List<TColumn> columnsList =
new ArrayList();
1003 columnsList.add(schemaCol);
1004 columnsList.add(catalogCol);
1007 TRowSet rowSet =
new TRowSet(rowDesc, null, columnsList,
true);
1009 TQueryResult
result =
new TQueryResult(
1010 rowSet, 0, 0, null, null,
true, ai.heavy.thrift.server.TQueryType.UNKNOWN);
1018 HEAVYDBLOGGER.debug(
"Entered");
1024 HEAVYDBLOGGER.debug(
"Entered");
1027 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
1028 TColumnType columns[] = {
createTColumnType(
"TABLE_TYPE",
new TTypeInfo(strTTI))};
1030 Map<String, HeavyAIData> dataMap =
new HashMap(columns.length);
1034 List<TColumnType> rowDesc =
new ArrayList(columns.length);
1035 for (TColumnType col : columns) {
1037 dataMap.put(col.col_name,
new HeavyAIData(col.col_type.type));
1041 dataMap.get(
"TABLE_TYPE").add(
"TABLE");
1042 dataMap.get(
"TABLE_TYPE").add(
"VIEW");
1044 List<TColumn> columnsList =
new ArrayList(columns.length);
1046 for (TColumnType col : columns) {
1047 TColumn schemaCol = dataMap.get(col.col_name).getTColumn();
1048 columnsList.add(schemaCol);
1052 TRowSet rowSet =
new TRowSet(rowDesc, null, columnsList,
true);
1054 TQueryResult
result =
new TQueryResult(
1055 rowSet, 0, 0, null, null,
true, ai.heavy.thrift.server.TQueryType.UNKNOWN);
1157 String schemaPattern,
1158 String tableNamePattern,
1159 String columnNamePattern)
throws SQLException {
1160 HEAVYDBLOGGER.debug(
"Entered");
1161 HEAVYDBLOGGER.debug(
"TablePattern " + tableNamePattern +
" columnNamePattern "
1162 + columnNamePattern);
1163 String modifiedTablePattern = tableNamePattern.replaceAll(
"%",
".*");
1164 String modifiedColumnPattern =
1165 (columnNamePattern == null) ? null : columnNamePattern.replaceAll(
"%",
".*");
1167 HEAVYDBLOGGER.debug(
"TablePattern " + tableNamePattern +
" modifiedColumnPattern "
1168 + modifiedColumnPattern);
1172 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
1174 new TTypeInfo(TDatumType.INT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1175 TTypeInfo smallIntTTI =
1176 new TTypeInfo(TDatumType.SMALLINT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1202 Map<String, HeavyAIData> dataMap =
new HashMap(columns.length);
1206 List<TColumnType> rowDesc =
new ArrayList(columns.length);
1207 for (TColumnType col : columns) {
1209 dataMap.put(col.col_name,
new HeavyAIData(col.col_type.type));
1215 tables = con.client.get_tables_for_database(con.session, catalog);
1216 }
catch (TException ex) {
1217 throw new SQLException(
"get_tables_for_database failed " + ex.toString());
1220 for (String tableName : tables) {
1222 if (tableNamePattern == null || tableNamePattern.equals(tableName)) {
1224 TTableDetails tableDetails;
1226 tableDetails = con.client.get_table_details(con.session, tableName);
1227 }
catch (TException ex) {
1228 throw new SQLException(
"get_table_details failed " + ex.toString());
1233 for (TColumnType value : tableDetails.row_desc) {
1235 if (columnNamePattern == null
1236 || value.col_name.matches(modifiedColumnPattern)) {
1237 dataMap.get(
"TABLE_CAT").setNull(
true);
1238 dataMap.get(
"TABLE_SCHEM").setNull(
true);
1239 dataMap.get(
"TABLE_NAME").add(tableName);
1240 dataMap.get(
"COLUMN_NAME").add(value.col_name);
1242 dataMap.get(
"TYPE_NAME")
1243 .add((value.col_type.type.name()
1244 + (value.col_type.is_array ?
"[]" :
"")));
1245 if (value.col_type.type == TDatumType.DECIMAL) {
1246 dataMap.get(
"COLUMN_SIZE").add(value.col_type.precision);
1248 dataMap.get(
"COLUMN_SIZE").add(100);
1250 dataMap.get(
"BUFFER_LENGTH").setNull(
true);
1251 if (value.col_type.type == TDatumType.DECIMAL) {
1252 dataMap.get(
"DECIMAL_DIGITS").add(value.col_type.scale);
1254 dataMap.get(
"DECIMAL_DIGITS").setNull(
true);
1256 dataMap.get(
"NUM_PREC_RADIX").add(10);
1257 dataMap.get(
"NULLABLE")
1258 .add(value.col_type.nullable ? DatabaseMetaData.columnNullable
1259 : DatabaseMetaData.columnNoNulls);
1260 dataMap.get(
"REMARKS").add(
" ");
1261 dataMap.get(
"COLUMN_DEF").setNull(
true);
1262 dataMap.get(
"SQL_DATA_TYPE").add(0);
1263 dataMap.get(
"SQL_DATETIME_SUB").setNull(
true);
1264 dataMap.get(
"CHAR_OCTET_LENGTH").add(0);
1265 dataMap.get(
"ORDINAL_POSITION").add(ordinal);
1266 dataMap.get(
"IS_NULLABLE").add(value.col_type.nullable ?
"YES" :
"NO");
1267 dataMap.get(
"SCOPE_CATALOG").setNull(
true);
1268 dataMap.get(
"SCOPE_SCHEMA").setNull(
true);
1269 dataMap.get(
"SCOPE_TABLE").setNull(
true);
1271 dataMap.get(
"IS_AUTOINCREMENT").add(
"NO");
1272 dataMap.get(
"IS_GENERATEDCOLUMN").add(
"NO");
1278 List<TColumn> columnsList =
new ArrayList(columns.length);
1280 for (TColumnType col : columns) {
1281 TColumn schemaCol = dataMap.get(col.col_name).getTColumn();
1283 columnsList.add(schemaCol);
1287 TRowSet rowSet =
new TRowSet(rowDesc, null, columnsList,
true);
1289 TQueryResult
result =
new TQueryResult(
1290 rowSet, 0, 0, null, null,
true, ai.heavy.thrift.server.TQueryType.UNKNOWN);
1298 String catalog, String schema, String table, String columnNamePattern)
1299 throws SQLException {
1300 HEAVYDBLOGGER.debug(
"Entered");
1301 throw new UnsupportedOperationException(
"Not supported yet,"
1302 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1303 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1304 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1314 throws SQLException {
1315 Map<String, HeavyAIData> dataMap =
new HashMap(columns.length);
1316 List<TColumnType> rowDesc =
new ArrayList(columns.length);
1317 for (TColumnType col : columns) {
1319 dataMap.put(col.col_name,
new HeavyAIData(col.col_type.type));
1321 List<TColumn> columnsList =
new ArrayList(columns.length);
1322 for (TColumnType col : columns) {
1323 TColumn schemaCol = dataMap.get(col.col_name).getTColumn();
1324 columnsList.add(schemaCol);
1326 TRowSet rowSet =
new TRowSet(rowDesc, null, columnsList,
true);
1327 TQueryResult
result =
new TQueryResult(
1328 rowSet, 0, 0, null, null,
true, ai.heavy.thrift.server.TQueryType.UNKNOWN);
1334 List<String>
tables, Map<String, HeavyAIData> dataMap, String tableNamePattern)
1336 for (String table :
tables) {
1337 if (tableNamePattern != null && !table.matches(tableNamePattern)) {
1340 List<TDBObject> db_objects = con.client.get_db_object_privs(
1344 for (TDBObject db_object : db_objects) {
1347 if (db_object.objectName.equalsIgnoreCase(
"super")) {
1348 db_object.objectName = table;
1351 if (!db_object.objectName.equalsIgnoreCase(table)) {
1357 TTablePermissions tt =
new TTablePermissions(db_object.privs.get(0),
1358 db_object.privs.get(1),
1359 db_object.privs.get(2),
1360 db_object.privs.get(3),
1361 db_object.privs.get(4),
1362 db_object.privs.get(5),
1363 db_object.privs.get(6),
1364 db_object.privs.get(7));
1367 for (TTablePermissions._Fields
field = tt.fieldForId(ordinal);
field != null;
1368 field = tt.fieldForId(++ordinal)) {
1369 Boolean x = (Boolean) tt.getFieldValue(
field);
1375 dataMap.get(
"PRIVILEGE")
1376 .add(
field.getFieldName().toUpperCase().replace(
"_",
""));
1377 dataMap.get(
"TABLE_CAT").setNull(
true);
1378 dataMap.get(
"TABLE_SCHEM").setNull(
true);
1379 dataMap.get(
"TABLE_NAME").add(db_object.objectName);
1380 dataMap.get(
"GRANTOR").setNull(
true);
1381 dataMap.get(
"GRANTEE").add(db_object.grantee);
1382 dataMap.get(
"IS_GRANTABLE").add(
"NO");
1390 String catalog, String schemaPattern, String tableNamePattern)
1391 throws SQLException {
1392 HEAVYDBLOGGER.debug(
"Entered");
1394 String modifiedTablePattern =
1395 (tableNamePattern == null) ? null : tableNamePattern.replaceAll(
"%",
".*");
1397 HEAVYDBLOGGER.debug(
"TablePattern " + tableNamePattern +
" modifiedTableNamePattern "
1398 + modifiedTablePattern);
1401 final TTypeInfo strTTI =
1402 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
1405 Map<String, HeavyAIData> dataMap =
new HashMap() {
1419 List<String>
tables = con.client.get_tables(con.session);
1421 }
catch (TException ex) {
1422 throw new SQLException(
"get_privileges failed " + ex.toString());
1429 List<TColumnType> rowDesc =
new ArrayList(dataMap.size());
1430 List<TColumn> columnsList =
new ArrayList(dataMap.size());
1432 for (Map.Entry<String,
HeavyAIData> pair : dataMap.entrySet()) {
1433 columnsList.add(pair.getValue().getTColumn());
1438 TRowSet rowSet =
new TRowSet(rowDesc, null, columnsList,
true);
1440 TQueryResult
result =
new TQueryResult(
1441 rowSet, 0, 0, null, null,
true, ai.heavy.thrift.server.TQueryType.UNKNOWN);
1449 String catalog, String schema, String table,
int scope,
boolean nullable)
1450 throws SQLException {
1451 HEAVYDBLOGGER.debug(
"Entered");
1452 throw new UnsupportedOperationException(
"Not supported yet,"
1453 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1454 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1455 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1460 throws SQLException {
1461 HEAVYDBLOGGER.debug(
"Entered");
1462 throw new UnsupportedOperationException(
"Not supported yet,"
1463 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1464 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1465 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1470 throws SQLException {
1471 HEAVYDBLOGGER.debug(
"Entered");
1474 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
1476 new TTypeInfo(TDatumType.INT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1477 TTypeInfo smallIntTTI =
1478 new TTypeInfo(TDatumType.SMALLINT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1491 throws SQLException {
1492 HEAVYDBLOGGER.debug(
"Entered");
1495 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
1497 new TTypeInfo(TDatumType.INT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1498 TTypeInfo smallIntTTI =
1499 new TTypeInfo(TDatumType.SMALLINT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1500 TColumnType columns[] = {
createTColumnType(
"PKTABLE_CAT",
new TTypeInfo(strTTI)),
1520 throws SQLException {
1521 HEAVYDBLOGGER.debug(
"Entered");
1524 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
1526 new TTypeInfo(TDatumType.INT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1527 TTypeInfo smallIntTTI =
1528 new TTypeInfo(TDatumType.SMALLINT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1529 TColumnType columns[] = {
createTColumnType(
"FKTABLE_CAT",
new TTypeInfo(strTTI)),
1549 String parentSchema,
1551 String foreignCatalog,
1552 String foreignSchema,
1553 String foreignTable)
throws SQLException {
1554 HEAVYDBLOGGER.debug(
"Entered");
1555 throw new UnsupportedOperationException(
"Not supported yet,"
1556 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1557 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1558 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1626 HEAVYDBLOGGER.debug(
"Entered");
1630 new TTypeInfo(TDatumType.STR, TEncodingType.NONE,
false,
false, 0, 0, 0);
1632 new TTypeInfo(TDatumType.INT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1633 TTypeInfo smallIntTTI =
1634 new TTypeInfo(TDatumType.SMALLINT, TEncodingType.NONE,
false,
false, 0, 0, 0);
1636 new TTypeInfo(TDatumType.BOOL, TEncodingType.NONE,
false,
false, 0, 0, 0);
1656 Map<String, HeavyAIData> dataMap =
new HashMap(columns.length);
1660 List<TColumnType> rowDesc =
new ArrayList(columns.length);
1661 for (TColumnType col : columns) {
1663 dataMap.put(col.col_name,
new HeavyAIData(col.col_type.type));
1667 dataMap.get(
"TYPE_NAME").setNull(
true);
1668 dataMap.get(
"DATA_TYPE").setNull(
true);
1669 dataMap.get(
"PRECISION").setNull(
true);
1670 dataMap.get(
"LITERAL_PREFIX").setNull(
true);
1672 dataMap.get(
"LITERAL_SUFFIX").setNull(
true);
1674 dataMap.get(
"CREATE_PARAMS")
1677 dataMap.get(
"NULLABLE").setNull(
true);
1681 dataMap.get(
"CASE_SENSITIVE").setNull(
true);
1682 dataMap.get(
"SEARCHABLE")
1688 dataMap.get(
"UNSIGNED_ATTRIBUTE").setNull(
true);
1689 dataMap.get(
"FIXED_PREC_SCALE").setNull(
true);
1690 dataMap.get(
"AUTO_INCREMENT")
1692 dataMap.get(
"LOCAL_TYPE_NAME")
1694 dataMap.get(
"MINIMUM_SCALE").setNull(
true);
1695 dataMap.get(
"MAXIMUM_SCALE").setNull(
true);
1696 dataMap.get(
"SQL_DATA_TYPE").setNull(
true);
1697 dataMap.get(
"SQL_DATETIME_SUB").setNull(
true);
1698 dataMap.get(
"NUM_PREC_RADIX").setNull(
true);
1700 List<TColumn> columnsList =
new ArrayList(columns.length);
1702 for (TColumnType col : columns) {
1703 TColumn schemaCol = dataMap.get(col.col_name).getTColumn();
1705 columnsList.add(schemaCol);
1709 TRowSet rowSet =
new TRowSet(rowDesc, null, columnsList,
true);
1711 TQueryResult
result =
new TQueryResult(
1712 rowSet, 0, 0, null, null,
true, ai.heavy.thrift.server.TQueryType.UNKNOWN);
1723 boolean approximate)
throws SQLException {
1724 HEAVYDBLOGGER.debug(
"Entered");
1730 HEAVYDBLOGGER.debug(
"Entered");
1736 throws SQLException {
1737 HEAVYDBLOGGER.debug(
"Entered");
1743 HEAVYDBLOGGER.debug(
"Entered");
1749 HEAVYDBLOGGER.debug(
"Entered");
1755 HEAVYDBLOGGER.debug(
"Entered");
1761 HEAVYDBLOGGER.debug(
"Entered");
1767 HEAVYDBLOGGER.debug(
"Entered");
1773 HEAVYDBLOGGER.debug(
"Entered");
1779 HEAVYDBLOGGER.debug(
"Entered");
1785 HEAVYDBLOGGER.debug(
"Entered");
1791 HEAVYDBLOGGER.debug(
"Entered");
1797 HEAVYDBLOGGER.debug(
"Entered");
1803 String catalog, String schemaPattern, String typeNamePattern,
int[] types)
1804 throws SQLException {
1805 HEAVYDBLOGGER.debug(
"Entered");
1806 throw new UnsupportedOperationException(
"Not supported yet,"
1807 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1808 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1809 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1814 HEAVYDBLOGGER.debug(
"Entered");
1820 HEAVYDBLOGGER.debug(
"Entered");
1826 HEAVYDBLOGGER.debug(
"Entered");
1832 HEAVYDBLOGGER.debug(
"Entered");
1838 HEAVYDBLOGGER.debug(
"Entered");
1844 String catalog, String schemaPattern, String typeNamePattern)
1845 throws SQLException {
1846 HEAVYDBLOGGER.debug(
"Entered");
1847 throw new UnsupportedOperationException(
"Not supported yet,"
1848 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1849 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1850 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1855 String catalog, String schemaPattern, String tableNamePattern)
1856 throws SQLException {
1857 HEAVYDBLOGGER.debug(
"Entered");
1858 throw new UnsupportedOperationException(
"Not supported yet,"
1859 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1860 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1861 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1866 String schemaPattern,
1867 String typeNamePattern,
1868 String attributeNamePattern)
throws SQLException {
1869 HEAVYDBLOGGER.debug(
"Entered");
1870 throw new UnsupportedOperationException(
"Not supported yet,"
1871 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1872 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1873 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1878 HEAVYDBLOGGER.debug(
"Entered");
1884 HEAVYDBLOGGER.debug(
"Entered");
1885 return ResultSet.CLOSE_CURSORS_AT_COMMIT;
1890 HEAVYDBLOGGER.debug(
"Entered");
1891 return this.databaseMajorVersion;
1896 HEAVYDBLOGGER.debug(
"Entered");
1897 return this.databaseMinorVersion;
1902 HEAVYDBLOGGER.debug(
"Entered");
1908 HEAVYDBLOGGER.debug(
"Entered");
1914 HEAVYDBLOGGER.debug(
"Entered");
1920 HEAVYDBLOGGER.debug(
"Entered");
1926 HEAVYDBLOGGER.debug(
"Entered");
1932 HEAVYDBLOGGER.debug(
"Entered");
1933 return RowIdLifetime.ROWID_VALID_OTHER;
1937 public ResultSet
getSchemas(String catalog, String schemaPattern)
throws SQLException {
1938 HEAVYDBLOGGER.debug(
"Entered");
1944 HEAVYDBLOGGER.debug(
"Entered");
1950 HEAVYDBLOGGER.debug(
"Entered");
1956 HEAVYDBLOGGER.debug(
"Entered");
1957 throw new UnsupportedOperationException(
"Not supported yet,"
1958 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1959 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1960 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1965 String catalog, String schemaPattern, String functionNamePattern)
1966 throws SQLException {
1967 HEAVYDBLOGGER.debug(
"Entered");
1968 throw new UnsupportedOperationException(
"Not supported yet,"
1969 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1970 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1971 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1976 String schemaPattern,
1977 String functionNamePattern,
1978 String columnNamePattern)
throws SQLException {
1979 HEAVYDBLOGGER.debug(
"Entered");
1980 throw new UnsupportedOperationException(
"Not supported yet,"
1981 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1982 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1983 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
1988 String schemaPattern,
1989 String tableNamePattern,
1990 String columnNamePattern)
throws SQLException {
1991 HEAVYDBLOGGER.debug(
"Entered");
1992 throw new UnsupportedOperationException(
"Not supported yet,"
1993 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
1994 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
1995 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
2000 HEAVYDBLOGGER.debug(
"Entered");
2005 public <T>
T unwrap(Class<T> iface)
throws SQLException {
2006 HEAVYDBLOGGER.debug(
"Entered");
2012 HEAVYDBLOGGER.debug(
"Entered");
static int toJava(TDatumType type)
static int DriverMajorVersion
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
static String DriverVersion
static int DriverMinorVersion