Skip to content

Commit

Permalink
Fix the bug of storePath substring on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhangshunyu authored and jackylk committed Nov 28, 2016
1 parent 1f09558 commit db98161
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@ public CarbonTableIdentifier getCarbonTableIdentifier() {
}

public static AbsoluteTableIdentifier fromTablePath(String tablePath) {
String[] names = tablePath.replace('\\', '/').split("/");
String formattedTablePath = tablePath.replace('\\', '/');
String[] names = formattedTablePath.split("/");
if (names.length < 3) {
throw new IllegalArgumentException("invalid table path: " + tablePath);
}

String tableName = names[names.length - 1];
String dbName = names[names.length - 2];
String storePath = tablePath.substring(0, tablePath.lastIndexOf(dbName +
String storePath = formattedTablePath.substring(0, formattedTablePath.lastIndexOf(dbName +
CarbonCommonConstants.FILE_SEPARATOR + tableName));

CarbonTableIdentifier identifier =
Expand Down

0 comments on commit db98161

Please sign in to comment.