GoogleCloudPlatform / google-cloud-powershell

PowerShell cmdlets for the Google Cloud Platform
http://googlecloudplatform.github.io/google-cloud-powershell/
Apache License 2.0
135 stars 61 forks source link

WriteMode flag not implemented for Query Jobs in Start-BqJob #582

Closed adarobin closed 6 years ago

adarobin commented 6 years ago

It would be useful if Start-BqJob implemented the WriteMode flag for Query Jobs. I'd like to be able to pass -WriteMode WriteTruncate to some of my Queries.

quoctruong commented 6 years ago

Hi @adarobin, can you clarify on the requirements or give an example of the usage? I thought the Start-BqJob command has -WriteMode WriteTruncate?

adarobin commented 6 years ago

Hi @quoctruong, The Start-BqJob has -WriteMode WriteTruncate but it is only available in the parameter set for Copy Jobs, not Query Jobs.

PS /Users/adarobin> Start-BqJob -Query -QueryString "SELECT * FROM ``foo``" -Destination $destTable -WriteMode WriteTruncate                                    
Start-BqJob : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Start-BqJob -Query -QueryString "SELECT * FROM ``foo``" -Destination  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Start-BqJob], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Google.PowerShell.BigQuery.StartBqJob
quoctruong commented 6 years ago

@adarobin We've implemented the feature. It will be out in the next time the module is released!

quoctruong commented 6 years ago

@adarobin Version 1.0.1.3 of the module (which is available on the PowerShellGallery) has this fix.