mirror of https://github.com/apache/druid.git
Properly url encode schema and table names when syncing catalog (#17131)
* SQL syntax error should target USER persona * * revert change to queryHandler and related tests, based on review comments * * add test * Properly encode schema and table names when syncing catalog Previously table names and schema names were not being properly url encododed when requested. Now they are.
This commit is contained in:
parent
37a2a12d79
commit
ba8245f114
|
@ -86,7 +86,7 @@ public class CatalogClient implements CatalogSource
|
|||
@Override
|
||||
public List<TableMetadata> tablesForSchema(String dbSchema)
|
||||
{
|
||||
String url = StringUtils.replace(SCHEMA_SYNC_PATH, "{schema}", dbSchema);
|
||||
String url = StringUtils.replace(SCHEMA_SYNC_PATH, "{schema}", StringUtils.urlEncode(dbSchema));
|
||||
List<TableMetadata> results = send(url, LIST_OF_TABLE_METADATA_TYPE);
|
||||
|
||||
// Not found for a list is an empty list.
|
||||
|
@ -96,8 +96,8 @@ public class CatalogClient implements CatalogSource
|
|||
@Override
|
||||
public TableMetadata table(TableId id)
|
||||
{
|
||||
String url = StringUtils.replace(TABLE_SYNC_PATH, "{schema}", id.schema());
|
||||
url = StringUtils.replace(url, "{name}", id.name());
|
||||
String url = StringUtils.replace(TABLE_SYNC_PATH, "{schema}", StringUtils.urlEncode(id.schema()));
|
||||
url = StringUtils.replace(url, "{name}", StringUtils.urlEncode(id.name()));
|
||||
return send(url, TABLE_METADATA_TYPE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue