Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get last element as a table name from a topic name #339

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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;
}

}
}
Loading