Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:table: Properly read and import table state #314

Merged
merged 6 commits into from
Nov 25, 2020

Conversation

edulop91
Copy link

@edulop91 edulop91 commented Nov 25, 2020

The table.Read functionality wasn't correctly importing all state. For example, we wouldn't set the columns of an imported table. This patch augments the Read function to more fully refresh table state (and therefore the ability to properly import a table).

Note that Snowflake doesn't properly "reflect back" some values. For example, if you create a table with STRING as a type Snowflake will silently convert it to a VARCHAR(...) type when you query back the col type.

Test Plan

  • [x ] acceptance tests
  • [ x] ran in an internal repo to test importing a table (make sure it failed without this patch and then succeed with this patch)

References

@edulop91 edulop91 requested a review from a team as a code owner November 25, 2020 16:31
@edulop91 edulop91 requested review from ryanking and removed request for a team November 25, 2020 16:31
@edulop91 edulop91 requested review from kuannie1 and damien November 25, 2020 16:39
@czimergebot czimergebot merged commit df1f6bc into main Nov 25, 2020
@czimergebot czimergebot deleted the edu/table-read-properly branch November 25, 2020 22:44
gjv9491 pushed a commit to gjv9491/terraform-provider-snowflake that referenced this pull request Mar 19, 2021
<!-- Feel free to delete comments as you fill this in -->

<!-- summary of changes -->
The table.Read functionality wasn't correctly importing all state. For example, we wouldn't set the columns of an imported table. This patch augments the Read function to more fully refresh table state (and therefore the ability to properly import a table).

Note that Snowflake doesn't properly "reflect back" some values. For example, if you create a table with `STRING` as a type Snowflake will silently convert it to a VARCHAR(...) type when you query back the col type.

## Test Plan
<!-- detail ways in which this PR has been tested or needs to be tested -->
* [x ] acceptance tests
<!-- add more below if you think they are relevant -->
* [ x] ran in an internal repo to test importing a table (make sure it failed without this patch and then succeed with this patch)

## References
<!-- issues documentation links, etc  -->

*
anton-chekanov pushed a commit to anton-chekanov/terraform-provider-snowflake that referenced this pull request Jan 25, 2022
<!-- Feel free to delete comments as you fill this in -->

<!-- summary of changes -->
The table.Read functionality wasn't correctly importing all state. For example, we wouldn't set the columns of an imported table. This patch augments the Read function to more fully refresh table state (and therefore the ability to properly import a table).

Note that Snowflake doesn't properly "reflect back" some values. For example, if you create a table with `STRING` as a type Snowflake will silently convert it to a VARCHAR(...) type when you query back the col type.

## Test Plan
<!-- detail ways in which this PR has been tested or needs to be tested -->
* [x ] acceptance tests
<!-- add more below if you think they are relevant -->
* [ x] ran in an internal repo to test importing a table (make sure it failed without this patch and then succeed with this patch)

## References
<!-- issues documentation links, etc  -->

*
daniepett pushed a commit to daniepett/terraform-provider-snowflake that referenced this pull request Feb 9, 2022
<!-- Feel free to delete comments as you fill this in -->

<!-- summary of changes -->
The table.Read functionality wasn't correctly importing all state. For example, we wouldn't set the columns of an imported table. This patch augments the Read function to more fully refresh table state (and therefore the ability to properly import a table).

Note that Snowflake doesn't properly "reflect back" some values. For example, if you create a table with `STRING` as a type Snowflake will silently convert it to a VARCHAR(...) type when you query back the col type.

## Test Plan
<!-- detail ways in which this PR has been tested or needs to be tested -->
* [x ] acceptance tests
<!-- add more below if you think they are relevant -->
* [ x] ran in an internal repo to test importing a table (make sure it failed without this patch and then succeed with this patch)

## References
<!-- issues documentation links, etc  -->

*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants