-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix cortex search service (#2904)
- fix integration tests - fix datasource (multiple errors) - add missing force news - add missing examples and imports - add disclaimer - fix resource logic - skip resource test (error with no db in session) - fix datasource acceptance test - fix docs around grants - add tests for grants (normal, plural, and ownership)
- Loading branch information
1 parent
43aa89f
commit 763d06c
Showing
30 changed files
with
616 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
examples/data-sources/snowflake_cortex_search_services/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Simple usage | ||
data "snowflake_cortex_search_services" "simple" { | ||
} | ||
|
||
output "simple_output" { | ||
value = data.snowflake_cortex_search_services.simple.cortex_search_services | ||
} | ||
|
||
# Filtering (like) | ||
data "snowflake_cortex_search_services" "like" { | ||
like = "some-name" | ||
} | ||
|
||
output "like_output" { | ||
value = data.snowflake_cortex_search_services.like.cortex_search_services | ||
} | ||
|
||
# Filtering (starts_with) | ||
data "snowflake_cortex_search_services" "starts_with" { | ||
starts_with = "prefix-" | ||
} | ||
|
||
output "starts_with_output" { | ||
value = data.snowflake_cortex_search_services.starts_with.cortex_search_services | ||
} | ||
|
||
# Filtering (limit) | ||
data "snowflake_cortex_search_services" "limit" { | ||
limit { | ||
rows = 10 | ||
from = "prefix-" | ||
} | ||
} | ||
|
||
output "limit_output" { | ||
value = data.snowflake_cortex_search_services.limit.cortex_search_services | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import snowflake_cortex_search_service.example 'dbName|schemaName|fileFormatName' |
38 changes: 38 additions & 0 deletions
38
examples/resources/snowflake_cortex_search_service/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Basic | ||
resource "snowflake_database" "test" { | ||
name = "some_database" | ||
} | ||
|
||
resource "snowflake_schema" "test" { | ||
database = snowflake_database.test.name | ||
name = "some_schema" | ||
} | ||
|
||
resource "snowflake_table" "test" { | ||
database = snowflake_database.test.name | ||
schema = snowflake_schema.test.name | ||
name = "some_table" | ||
change_tracking = true | ||
column { | ||
name = "ID" | ||
type = "NUMBER(38,0)" | ||
} | ||
|
||
column { | ||
name = "SOME_TEXT" | ||
type = "VARCHAR" | ||
} | ||
} | ||
|
||
resource "snowflake_cortex_search_service" "test" { | ||
depends_on = [snowflake_table.test] | ||
|
||
database = snowflake_database.test.name | ||
schema = snowflake_schema.test.name | ||
name = "some_name" | ||
on = "SOME_TEXT" | ||
target_lag = "2 minutes" | ||
warehouse = "some_warehouse" | ||
query = "SELECT SOME_TEXT FROM \"some_database\".\"some_schema\".\"some_table\"" | ||
comment = "some comment" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.