Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,14 @@ public static Map<String, String> parseTopicToTableMap(String input) throws Exce
* @return Table Name
*/
public static String getTableNameFromTopic(String topicName) {
String tableName = null;
String tableName = null;

// get last element after deviding topicName by "." as tableName
String[] splitName = topicName.split("\\.");
tableName = splitName[splitName.length - 1];

// topic names is of the following format.
// hostname.dbName.tableName
String[] splitName = topicName.split("\\.");
if(splitName.length == 3) {
tableName = splitName[2];
}

return tableName;
}
return tableName;
}
/**
* Function to valid table name passed in settings
* //ToDO: Implement the function.
Expand All @@ -108,4 +104,4 @@ public static boolean isValidTable(String tableName) {
return true;
}

}
}