Hi team,

I recently upgraded to v6 and found the ad_group_ad.policy_summary 
<https://developers.google.com/google-ads/api/reference/rpc/v6/AdGroupAd> 
can't be selected. It works correctly in v3.
code:
String customerId = "xxxxxxx";
int pageSize = 100;
String sql = "SELECT ad_group.id, ad_group.name, ad_group_ad.ad.id, 
customer.id, campaign.id, ad_group_ad.ad.type, ad_group_ad.policy_summary 
FROM ad_group_ad";
GoogleAdsClient googleAdsClient;
googleAdsClient = GoogleAdsClient.newBuilder().fromPropertiesFile().build();
try (GoogleAdsServiceClient googleAdsServiceClient =
googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
SearchGoogleAdsRequest.Builder builder =
SearchGoogleAdsRequest.newBuilder()
.setCustomerId(customerId)
.setPageSize(pageSize)
.setQuery(sql);

SearchGoogleAdsRequest request = builder.build();
// Issues the search request.
GoogleAdsServiceClient.SearchPagedResponse searchPagedResponse = 
googleAdsServiceClient.search(request);
}
}

response:
Exception in thread "main" 
com.google.ads.googleads.v6.errors.GoogleAdsException: errors {
  error_code {
    query_error: PROHIBITED_FIELD_IN_SELECT_CLAUSE
  }
  message: "The following field may not be used in SELECT clause: 
\'ad_group_ad.policy_summary\'."
}

at 
com.google.ads.googleads.v6.errors.GoogleAdsException$Factory.createException(GoogleAdsException.java:42)
at 
com.google.ads.googleads.v6.errors.GoogleAdsException$Factory.createException(GoogleAdsException.java:34)
at 
com.google.ads.googleads.lib.BaseGoogleAdsException$Factory.createGoogleAdsException(BaseGoogleAdsException.java:105)
at 
com.google.ads.googleads.lib.callables.GoogleAdsExceptionTransformation.transform(GoogleAdsExceptionTransformation.java:36)
at 
com.google.ads.googleads.lib.callables.ExceptionTransformingUnaryCallable$ExceptionTransformingFuture.onFailure(ExceptionTransformingUnaryCallable.java:82)
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
at 
com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1050)
at 
com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
at 
com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1176)
at 
com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:969)
at 
com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:760)
at 
com.google.api.gax.retrying.BasicRetryingFuture.handleAttempt(BasicRetryingFuture.java:179)
at 
com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.handle(CallbackChainRetryingFuture.java:135)
at 
com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.run(CallbackChainRetryingFuture.java:117)
at 
com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
at 
com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1176)
at 
com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:969)
at 
com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:760)
at 
com.google.api.core.AbstractApiFuture$InternalSettableFuture.setException(AbstractApiFuture.java:95)
at 
com.google.api.core.AbstractApiFuture.setException(AbstractApiFuture.java:77)
at 
com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
at 
com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1050)
at 
com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
at 
com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1176)
at 
com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:969)
at 
com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:760)
at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:545)
at 
io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:515)
at 
io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
at 
io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
at 
io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
at 
com.google.ads.googleads.lib.logging.LoggingInterceptor$1$1.onClose(LoggingInterceptor.java:111)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
at 
io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689)
at 
io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577)
at 
io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751)
at 
io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at 
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task 
failed
at 
com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57)
at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
at 
com.google.ads.googleads.v6.services.GoogleAdsServiceClient.search(GoogleAdsServiceClient.java:209)
at com.example.Tester.main(Tester.java:39)
Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request 
contains an invalid argument.
at io.grpc.Status.asRuntimeException(Status.java:533)
... 19 more

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/941f9524-edcc-40cf-8c0f-c44f6d17e8ban%40googlegroups.com.
  • ad_group_ad.policy_su... 'Dong Chen' via AdWords API and Google Ads API Forum

Reply via email to