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

feat: Added Query Acceleration for Warehouses #1239

Conversation

ChrisIsidora
Copy link
Contributor

Added Query Acceleration for Warehouses. (Currently in Preview)

References

@sfc-gh-swinkler
Copy link
Collaborator

the test account used for CI/CD is currently set to run in standard, not enterprise. i do have access to an enterprise test account and can switch the credentials to that one. how soon do you need this feature? i see it is a draft, so its not clear the priority

@ChrisIsidora
Copy link
Contributor Author

the test account used for CI/CD is currently set to run in standard, not enterprise. i do have access to an enterprise test account and can switch the credentials to that one. how soon do you need this feature? i see it is a draft, so its not clear the priority

@sfc-gh-swinkler This is a draft because I was not sure when this will be released for other non enterprise accounts and also for the reason that it's still in public preview. At this moment I does not have as high of a priority as the other PR that you already merged.

Do you think it;s wise to test en merge it now?

@marcincuber
Copy link

It would be great to get this merged and released.

@ChrisIsidora ChrisIsidora marked this pull request as ready for review October 19, 2022 07:34
@ChrisIsidora
Copy link
Contributor Author

It would be great to get this merged and released.

@marcincuber I removed it from Draft. @sfc-gh-swinkler Can you check if this doesn't break when these settings are not set and the account is not an Enterprise? Thanks in advance

@ChrisIsidora ChrisIsidora changed the title Added Query Acceleration for Warehouses feat: Added Query Acceleration for Warehouses Oct 19, 2022
@sfc-gh-swinkler
Copy link
Collaborator

/ok-to-test sha=e7a5a90

@github-actions
Copy link

Integration tests failure for e7a5a90

@ChrisIsidora
Copy link
Contributor Author

@sfc-gh-swinkler Added docs can you run the tests again? Thanks in advance

@sfc-gh-swinkler
Copy link
Collaborator

/ok-to-test sha =55e107d

@github-actions
Copy link

Integration tests failure for

@sfc-gh-swinkler
Copy link
Collaborator

Hey @ChrisIsidora

getting the following error:

> 
> > --- FAIL: TestWarehouseCreate (0.00s)
> >     warehouse_test.go:36: 
> >         	Error Trace:	/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/warehouse_test.go:36
> >         	            				/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/helpers.go:21
> >         	            				/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/warehouse_test.go:32
> >         	Error:      	Received unexpected error:
> >         	            	enable_query_acceleration: '' expected type 'bool', got unconvertible type 'sql.NullBool', value: '{false false}'
> >         	Test:       	TestWarehouseCreate
> > --- FAIL: TestWarehouseRead (0.00s)
> >     warehouse_test.go:58: 
> >         	Error Trace:	/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/warehouse_test.go:58
> >         	            				/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/helpers.go:21
> >         	            				/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/warehouse_test.go:55
> >         	Error:      	Received unexpected error:
> >         	            	enable_query_acceleration: '' expected type 'bool', got unconvertible type 'sql.NullBool', value: '{false false}'
> >         	Test:       	TestWarehouseRead

i have had this same problem before all you have to do is <var>.Bool to get the correct result. Otherwise looks like everything is good.

@ChrisIsidora
Copy link
Contributor Author

@sfc-gh-swinkler I made the changes I think?

@sfc-gh-swinkler
Copy link
Collaborator

@ChrisIsidora it is failing on check-docs. Could you please run make docs? if that doesn't work then i will just merge and fix it later.

@ChrisIsidora
Copy link
Contributor Author

@sfc-gh-swinkler The docs were already made, I made some changes for the bool property

@sfc-gh-swinkler
Copy link
Collaborator

hmm well it looks like rebasing to main helped. Getting a new error

--- FAIL: TestWarehouseCreate (0.00s)
    warehouse_test.go:36: 
        	Error Trace:	/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/warehouse_test.go:36
        	            				/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/helpers.go:21
        	            				/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/warehouse_test.go:32
        	Error:      	Received unexpected error:
        	            	query_acceleration_max_scale_factor: '' expected type 'int', got unconvertible type 'sql.NullInt64', value: '{0 false}'
        	Test:       	TestWarehouseCreate
--- FAIL: TestWarehouseRead (0.00s)
    warehouse_test.go:58: 
        	Error Trace:	/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/warehouse_test.go:58
        	            				/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/helpers.go:21
        	            				/home/runner/work/terraform-provider-snowflake/terraform-provider-snowflake/pkg/resources/warehouse_test.go:55
        	Error:      	Received unexpected error:
        	            	query_acceleration_max_scale_factor: '' expected type 'int', got unconvertible type 'sql.NullInt64', value: '{0 false}'
        	Test:       	TestWarehouseRead
FAIL

looks like you need to do change the following:

	err = d.Set("query_acceleration_max_scale_factor", w.QueryAccelerationMaxScaleFactor)

to

	err = d.Set("query_acceleration_max_scale_factor", int(w.QueryAccelerationMaxScaleFactor.Int64))

or something like that

@ChrisIsidora
Copy link
Contributor Author

@sfc-gh-swinkler Made some changes for the int property

@sfc-gh-swinkler sfc-gh-swinkler merged commit ad4ce91 into Snowflake-Labs:main Oct 28, 2022
@sfc-gh-swinkler
Copy link
Collaborator

@ChrisIsidora great thanks! I appreciate your contribution.

@ChrisIsidora ChrisIsidora deleted the feature/added-query-acceleration-warehouse branch November 2, 2022 07:11
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