@Test public void testFetchValue() { Map<String, String> map = new HashMap<>(); String guess = JdbcHiveInputBase.fetchValue("DB_1", "TB_2", "COL_3", map); assertEquals("DB_1.TB_2.COL_3", guess); map.put("DB_1.TB_2.COL_3", "Db_1.Tb_2.Col_3"); guess = JdbcHiveInputBase.fetchValue("DB_1", "TB_2", "COL_3", map); assertEquals("Db_1.Tb_2.Col_3", guess); }
static String fetchValue(String database, String table, String column, Map<String, String> metadataMap) { String key; if (table == null && column == null) { key = database; } else if (column == null) { key = database + "." + table; } else { key = database + "." + table + "." + column; } String val = metadataMap.get(key.toUpperCase(Locale.ROOT)); if (val == null) { logger.warn("Not find for {} from metadata cache.", key); return key; } else { return val; } }
JdbcHiveInputBase extends HiveInputBase { static String fetchValue(String database, String table, String column, Map<String, String> metadataMap) { String key; if (table == null && column == null) { key = database; } else if (column == null) { key = database + "." + table; } else { key = database + "." + table + "." + column; } String val = metadataMap.get(key.toUpperCase(Locale.ROOT)); if (val == null) { logger.warn("Not find for {} from metadata cache.", key); return key; } else { return val; } } }
JdbcHiveInputBase extends HiveInputBase { static String fetchValue(String database, String table, String column, Map<String, String> metadataMap) { String key; if (table == null && column == null) { key = database; } else if (column == null) { key = database + "." + table; } else { key = database + "." + table + "." + column; } String val = metadataMap.get(key.toUpperCase(Locale.ROOT)); if (val == null) { logger.warn("Not find for {} from metadata cache.", key); return key; } else { return val; } }  }
JdbcHiveInputBase extends HiveInputBase { static String fetchValue(String database, String table, String column, Map<String, String> metadataMap) { String key; if (table == null && column == null) { key = database; } else if (column == null) { key = database + "." + table; } else { key = database + "." + table + "." + column; } String val = metadataMap.get(key.toUpperCase(Locale.ROOT)); if (val == null) { logger.warn("Not find for {} from metadata cache.", key); return key; } else { return val; } }   }
JdbcHiveInputBase extends HiveInputBase { static String fetchValue(String database, String table, String column, Map<String, String> metadataMap) { String key; if (table == null && column == null) { key = database; } else if (column == null) { key = database + "." + table; } else { key = database + "." + table + "." + column; } String val = metadataMap.get(key.toUpperCase(Locale.ROOT)); if (val == null) { logger.warn("Not find for {} from metadata cache.", key); return key; } else { return val; } }    }