Skip to content

Commit 0607465

Browse files
SNOW-1619625: Add exact search for schema (#2012)
1 parent 4d73661 commit 0607465

File tree

5 files changed

+432
-92
lines changed

5 files changed

+432
-92
lines changed

src/main/java/net/snowflake/client/core/SFBaseSession.java

+13
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ public abstract class SFBaseSession {
139139
// we need to allow for it to maintain backwards compatibility.
140140
private boolean enablePatternSearch = true;
141141

142+
// Enables the use of exact schema searches for certain DatabaseMetaData methods
143+
// that should use schema from context (CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX=true)
144+
// value is false for backwards compatibility.
145+
private boolean enableExactSchemaSearch = false;
146+
142147
/** Disable lookup for default credentials by GCS library */
143148
private boolean disableGcsDefaultCredentials = false;
144149

@@ -1091,6 +1096,14 @@ public void setEnablePatternSearch(boolean enablePatternSearch) {
10911096
this.enablePatternSearch = enablePatternSearch;
10921097
}
10931098

1099+
public boolean getEnableExactSchemaSearch() {
1100+
return enableExactSchemaSearch;
1101+
}
1102+
1103+
void setEnableExactSchemaSearch(boolean enableExactSchemaSearch) {
1104+
this.enableExactSchemaSearch = enableExactSchemaSearch;
1105+
}
1106+
10941107
public boolean getDisableGcsDefaultCredentials() {
10951108
return disableGcsDefaultCredentials;
10961109
}

src/main/java/net/snowflake/client/core/SFSession.java

+7
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,13 @@ public void addSFSessionProperty(String propertyName, Object propertyValue) thro
510510
setEnablePatternSearch(getBooleanValue(propertyValue));
511511
}
512512
break;
513+
514+
case ENABLE_EXACT_SCHEMA_SEARCH_ENABLED:
515+
if (propertyValue != null) {
516+
setEnableExactSchemaSearch(getBooleanValue(propertyValue));
517+
}
518+
break;
519+
513520
case DISABLE_GCS_DEFAULT_CREDENTIALS:
514521
if (propertyValue != null) {
515522
setDisableGcsDefaultCredentials(getBooleanValue(propertyValue));

src/main/java/net/snowflake/client/core/SFSessionProperty.java

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public enum SFSessionProperty {
9595
DIAGNOSTICS_ALLOWLIST_FILE("DIAGNOSTICS_ALLOWLIST_FILE", false, String.class),
9696

9797
ENABLE_PATTERN_SEARCH("enablePatternSearch", false, Boolean.class),
98+
ENABLE_EXACT_SCHEMA_SEARCH_ENABLED("ENABLE_EXACT_SCHEMA_SEARCH_ENABLED", false, Boolean.class),
9899

99100
DISABLE_GCS_DEFAULT_CREDENTIALS("disableGcsDefaultCredentials", false, Boolean.class),
100101

0 commit comments

Comments
 (0)