Пример #1
0
 protected void setupDbType(Map<String, DfColumnMeta> metaMap, String columnName, Column column) {
   final DfColumnMeta columnMeta = metaMap.get(columnName);
   final String dbTypeName;
   final String plainName = columnMeta.getDbTypeName();
   if (Srl.contains(plainName, ".")) { // basically for ARRAY and STRUCT type
     final String catalogSchema = Srl.substringLastFront(plainName, ".");
     final UnifiedSchema unifiedSchema = UnifiedSchema.createAsDynamicSchema(catalogSchema);
     if (unifiedSchema.isMainSchema()) {
       dbTypeName = Srl.substringLastRear(plainName, ".");
     } else {
       dbTypeName = plainName;
     }
   } else {
     dbTypeName = plainName;
   }
   column.setDbType(dbTypeName);
 }
Пример #2
0
 protected String doExtractCatalog() {
   final String pureUrl = Srl.substringFirstFront(_url, ";", "?", "&");
   final String catalog = Srl.substringLastRear(pureUrl, "/", ":");
   return !catalog.equals(pureUrl) ? catalog : null;
 }