We have seen a number of questions on how to avoid retrieving metadata on all objects when only a specific database or database schema is specified. This helps to improve performance of metadata operations and reduce overhead, especially for Snowflake customers with very large deployments that can contain large numbers of databases, schemas, tables and views.
Snowflake data is maintained in databases, each database consists of one or more schemas. Database objects such as tables and views are logically grouped in these database schemas.
If a table, schema or database has an underscore character in it's name, the getMetaData calls need to be handled in a specific manner. The default interpretation of the underscore character in ODBC and JDBC calls will be to handle it as a wildcard character i.e. referring to a specific schema database1.schema_name will actually retrieve all metadata in database1. A similar interpretation applies to database and table naming conventions as well.
To avoid having the underscore character being used as a wildcard and retrieving metadata for all objects, a backslash "\" character needs to be used in front of the underscore character to escape the underscore being used as a wildcard character. The drivers will then correctly identify the specific path for the objects to perform the metadata call.
Anything else that should be specified?