Skip to content

Commit

Permalink
HIVE-27337: Trim the starting and trailing white spaces in HMS for cr…
Browse files Browse the repository at this point in the history
…eate and alter queries
  • Loading branch information
saihemanth-cloudera committed May 12, 2023
1 parent 64bc8bb commit c79e517
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2276,6 +2276,9 @@ private void create_table_core(final RawStore ms, final CreateTableRequest req)
+ " already exists");
}

tbl.setDbName(tbl.getDbName().trim());
tbl.setTableName(tbl.getTableName().trim());

if (transformer != null) {
tbl = transformer.transformCreateTable(tbl, processorCapabilities, processorId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public void alterTable(RawStore msdb, Warehouse wh, String catName, String dbnam
IHMSHandler handler, String writeIdList)
throws InvalidOperationException, MetaException {
catName = normalizeIdentifier(catName);
name = name.toLowerCase();
dbname = dbname.toLowerCase();
name = name.trim().toLowerCase();
dbname = dbname.trim().toLowerCase();

final boolean cascade;
final boolean replDataLocationChanged;
Expand Down

0 comments on commit c79e517

Please sign in to comment.