(); QueryParameter param-6ren">
gpt4 book ai didi

java - GoogleJsonResponseException : 400 Bad Request "Invalid query parameter type"

转载 作者:行者123 更新时间:2023-12-01 09:16:55 27 4
gpt4 key购买 nike

我尝试以编程方式将参数注入(inject)到我的 bigQuery 查询中:

这是我的代码:

List<QueryParameter> params = new ArrayList<>();

QueryParameter param = new QueryParameter();
param.setName("@country");
param.setParameterValue(new QueryParameterValue().setValue(brandChangeDataUi.country));
param.setParameterType(new QueryParameterType().setType("string"));
params.add(param);

param = new QueryParameter();
param.setName("countryAbbr");
param.setParameterValue(new QueryParameterValue().setValue(brandChangeDataUi.countryAbbr));
param.setParameterType(new QueryParameterType().setType("string"));
params.add(param);

List<String> brands = brandChangeDataUi.brands;
List<String> brands2 = new ArrayList<>();
for (int i = 0; i < brands.size(); i++) {

param = new QueryParameter();
param.setName("brand" + i);
param.setParameterValue(new QueryParameterValue().setValue(brandChangeDataUi.brands.get(i)));
param.setParameterType(new QueryParameterType().setType("string"));
params.add(param);

brands2.add("@brand" + i);
}

JobConfigurationQuery jobConfigurationQuery = new JobConfigurationQuery();
jobConfigurationQuery.setQueryParameters(params);
jobConfigurationQuery.setUseLegacySql(false);

String listString = brands2.stream().map(brand -> "venue3.brand.value='"+ brand +"'").collect(Collectors.joining(" or "));

jobConfigurationQuery.setQuery("select * from [--table---] " +
"where (country = @country or country = @countryAbbr) and " +
"("+listString+") order by venue3.brand.value");



System.out.format("\nInserting Query Job: %s\n", jobConfigurationQuery.getQuery());

Job job = new Job();
JobConfiguration config = new JobConfiguration();
config.setQuery(jobConfigurationQuery);

job.setConfiguration(config);

Insert insert = bigquery.jobs().insert(projectId, job);
insert.setProjectId(projectId);
JobReference jobId = insert.execute().getJobReference();

System.out.format("\nJob ID of Query Job is: %s\n", jobId.getJobId());

return jobId;

我应该改变什么?当我收到错误并且不确定我的语法是否正确时

@conuntry是注入(inject)方式吗?

我看到了这个json并认为 "string"type

的有效值

我在控制台中看到了这个:

Inserting Query Job: select * from [MY_TABLE] where (country = @country or country = @countryAbbr) and (venue3.brand.value='@brand0') order by venue3.brand.value

com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid query parameter type",
"reason" : "invalid",
"debugInfo" : "[INVALID_INPUT], Reason: code=INVALID_INPUT message=Invalid query parameter type debug=null errorProto=domain: \"cloud.helix.ErrorDomain\"\ncode: \"INVALID_VALUE\"\nargument: \"Invalid query parameter type\"\nlocation_type: PATH\nlocation: \"configuration.query.query_options.parameters.parameter_type.type_kind\"\n\n\tat com.google.cloud.helix.common.Exceptions$Public.invalidInput(Exceptions.java:138)\n\tat com.google.cloud.helix.common.Exceptions$Public.invalidInput(Exceptions.java:147)\n\tat com.google.cloud.helix.server.common.Validator$Check.fail(Validator.java:362)\n\tat com.google.cloud.helix.server.common.Validator$Check.check(Validator.java:351)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1652)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1641)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1590)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1501)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:910)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:890)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy$JobValidator.validate(HelixJobRosy.java:512)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy.insert(HelixJobRosy.java:903)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy.insert(HelixJobRosy.java:1488)\n\tat sun.reflect.GeneratedMethodAccessor1198.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$1.call(RosyRequestProxy.java:398)\n\tat com.google.cloud.helix.common.rosy.RosyRequestDapperHookFactory$TracingRequestHook.call(RosyRequestDapperHookFactory.java:83)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestVarzHookFactory$Hook.call(RosyRequestVarzHookFactory.java:232)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.server.rosy.RosyRequestAuditHookFactory$1.call(RosyRequestAuditHookFactory.java:39)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.server.rosy.RosyRequestContextHookFactory$1.call(RosyRequestContextHookFactory.java:66)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestCredsHookFactory$1.call(RosyRequestCredsHookFactory.java:44)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestStatsRequestHookFactory$Hook$1.call(RosyRequestStatsRequestHookFactory.java:82)\n\tat com.google.tracing.LocalTraceSpanCallable.call(LocalTraceSpanCallable.java:67)\n\tat com.google.tracing.LocalTraceSpanCallable.callWithNoException(LocalTraceSpanCallable.java:85)\n\tat com.google.tracing.LocalTraceSpanBuilder.callWithNoException(LocalTraceSpanBuilder.java:632)\n\tat com.google.cloud.helix.common.StatsRequestLog.startTrace(StatsRequestLog.java:41)\n\tat com.google.cloud.helix.common.rosy.RosyRequestStatsRequestHookFactory$Hook.call(RosyRequestStatsRequestHookFactory.java:79)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestLogHookFactory$1.call(RosyRequestLogHookFactory.java:56)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy.invoke(RosyRequestProxy.java:565)\n\tat com.sun.proxy.$Proxy27.insert(Unknown Source)\n\tat com.google.cloud.helix.proto.proto2api.HelixJob$HelixJobService$ServiceParameters$1.handleRequest(HelixJob.java:23875)\n\tat com.google.net.rpc3.impl.server.RpcServerInternalContext.runRpcInApplication(RpcServerInternalContext.java:565)\n\tat com.google.net.rpc3.impl.server.RpcServerChannel$1$1.runInContext(RpcServerChannel.java:875)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:314)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:446)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.CurrentContext.runInContext(CurrentContext.java:274)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:312)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n\nRequest served by: /10.73.99.130:4774/statusz\ncom.google.api.server.core.Fault: ImmutableErrorDefinition{base=INVALID_PARAMETER, category=USER_ERROR, cause=null, debugInfo=[INVALID_INPUT], Reason: code=INVALID_INPUT message=Invalid query parameter type debug=null errorProto=domain: \"cloud.helix.ErrorDomain\"\ncode: \"INVALID_VALUE\"\nargument: \"Invalid query parameter type\"\nlocation_type: PATH\nlocation: \"configuration.query.query_options.parameters.parameter_type.type_kind\"\n\n\tat com.google.cloud.helix.common.Exceptions$Public.invalidInput(Exceptions.java:138)\n\tat com.google.cloud.helix.common.Exceptions$Public.invalidInput(Exceptions.java:147)\n\tat com.google.cloud.helix.server.common.Validator$Check.fail(Validator.java:362)\n\tat com.google.cloud.helix.server.common.Validator$Check.check(Validator.java:351)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1652)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1641)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1590)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1501)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:910)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:890)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy$JobValidator.validate(HelixJobRosy.java:512)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy.insert(HelixJobRosy.java:903)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy.insert(HelixJobRosy.java:1488)\n\tat sun.reflect.GeneratedMethodAccessor1198.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$1.call(RosyRequestProxy.java:398)\n\tat com.google.cloud.helix.common.rosy.RosyRequestDapperHookFactory$TracingRequestHook.call(RosyRequestDapperHookFactory.java:83)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestVarzHookFactory$Hook.call(RosyRequestVarzHookFactory.java:232)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.server.rosy.RosyRequestAuditHookFactory$1.call(RosyRequestAuditHookFactory.java:39)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.server.rosy.RosyRequestContextHookFactory$1.call(RosyRequestContextHookFactory.java:66)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestCredsHookFactory$1.call(RosyRequestCredsHookFactory.java:44)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestStatsRequestHookFactory$Hook$1.call(RosyRequestStatsRequestHookFactory.java:82)\n\tat com.google.tracing.LocalTraceSpanCallable.call(LocalTraceSpanCallable.java:67)\n\tat com.google.tracing.LocalTraceSpanCallable.callWithNoException(LocalTraceSpanCallable.java:85)\n\tat com.google.tracing.LocalTraceSpanBuilder.callWithNoException(LocalTraceSpanBuilder.java:632)\n\tat com.google.cloud.helix.common.StatsRequestLog.startTrace(StatsRequestLog.java:41)\n\tat com.google.cloud.helix.common.rosy.RosyRequestStatsRequestHookFactory$Hook.call(RosyRequestStatsRequestHookFactory.java:79)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestLogHookFactory$1.call(RosyRequestLogHookFactory.java:56)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy.invoke(RosyRequestProxy.java:565)\n\tat com.sun.proxy.$Proxy27.insert(Unknown Source)\n\tat com.google.cloud.helix.proto.proto2api.HelixJob$HelixJobService$ServiceParameters$1.handleRequest(HelixJob.java:23875)\n\tat com.google.net.rpc3.impl.server.RpcServerInternalContext.runRpcInApplication(RpcServerInternalContext.java:565)\n\tat com.google.net.rpc3.impl.server.RpcServerChannel$1$1.runInContext(RpcServerChannel.java:875)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:314)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:446)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.CurrentContext.runInContext(CurrentContext.java:274)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:312)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n\nRequest served by: /10.73.99.130:4774/statusz, domain=global, extendedHelp=null, httpHeaders={}, httpStatus=badRequest, internalReason=Reason{arguments={}, cause=null, code=cloud.helix.ErrorDomain.INVALID_VALUE, createdByBackend=true, debugMessage=[INVALID_INPUT], Reason: code=INVALID_INPUT message=Invalid query parameter type debug=null errorProto=domain: \"cloud.helix.ErrorDomain\"\ncode: \"INVALID_VALUE\"\nargument: \"Invalid query parameter type\"\nlocation_type: PATH\nlocation: \"configuration.query.query_options.parameters.parameter_type.type_kind\"\n\n\tat com.google.cloud.helix.common.Exceptions$Public.invalidInput(Exceptions.java:138)\n\tat com.google.cloud.helix.common.Exceptions$Public.invalidInput(Exceptions.java:147)\n\tat com.google.cloud.helix.server.common.Validator$Check.fail(Validator.java:362)\n\tat com.google.cloud.helix.server.common.Validator$Check.check(Validator.java:351)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1652)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1641)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1590)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1501)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:910)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:890)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy$JobValidator.validate(HelixJobRosy.java:512)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy.insert(HelixJobRosy.java:903)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy.insert(HelixJobRosy.java:1488)\n\tat sun.reflect.GeneratedMethodAccessor1198.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$1.call(RosyRequestProxy.java:398)\n\tat com.google.cloud.helix.common.rosy.RosyRequestDapperHookFactory$TracingRequestHook.call(RosyRequestDapperHookFactory.java:83)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestVarzHookFactory$Hook.call(RosyRequestVarzHookFactory.java:232)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.server.rosy.RosyRequestAuditHookFactory$1.call(RosyRequestAuditHookFactory.java:39)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.server.rosy.RosyRequestContextHookFactory$1.call(RosyRequestContextHookFactory.java:66)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestCredsHookFactory$1.call(RosyRequestCredsHookFactory.java:44)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestStatsRequestHookFactory$Hook$1.call(RosyRequestStatsRequestHookFactory.java:82)\n\tat com.google.tracing.LocalTraceSpanCallable.call(LocalTraceSpanCallable.java:67)\n\tat com.google.tracing.LocalTraceSpanCallable.callWithNoException(LocalTraceSpanCallable.java:85)\n\tat com.google.tracing.LocalTraceSpanBuilder.callWithNoException(LocalTraceSpanBuilder.java:632)\n\tat com.google.cloud.helix.common.StatsRequestLog.startTrace(StatsRequestLog.java:41)\n\tat com.google.cloud.helix.common.rosy.RosyRequestStatsRequestHookFactory$Hook.call(RosyRequestStatsRequestHookFactory.java:79)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestLogHookFactory$1.call(RosyRequestLogHookFactory.java:56)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy.invoke(RosyRequestProxy.java:565)\n\tat com.sun.proxy.$Proxy27.insert(Unknown Source)\n\tat com.google.cloud.helix.proto.proto2api.HelixJob$HelixJobService$ServiceParameters$1.handleRequest(HelixJob.java:23875)\n\tat com.google.net.rpc3.impl.server.RpcServerInternalContext.runRpcInApplication(RpcServerInternalContext.java:565)\n\tat com.google.net.rpc3.impl.server.RpcServerChannel$1$1.runInContext(RpcServerChannel.java:875)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:314)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:446)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.CurrentContext.runInContext(CurrentContext.java:274)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:312)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n\nRequest served by: /10.73.99.130:4774/statusz, errorProtoCode=INVALID_VALUE, errorProtoDomain=cloud.helix.ErrorDomain, filteredMessage=null, location=entity.configuration.query.query_options.parameters.parameter_type.type_kind, message=null, unnamedArguments=[Invalid query parameter type]}, location=entity.configuration.query.query_options.parameters.parameter_type.type_kind, message=Invalid query parameter type, reason=invalid, rpcCode=400} Invalid query parameter type: [INVALID_INPUT], Reason: code=INVALID_INPUT message=Invalid query parameter type debug=null errorProto=domain: \"cloud.helix.ErrorDomain\"\ncode: \"INVALID_VALUE\"\nargument: \"Invalid query parameter type\"\nlocation_type: PATH\nlocation: \"configuration.query.query_options.parameters.parameter_type.type_kind\"\n\n\tat com.google.cloud.helix.common.Exceptions$Public.invalidInput(Exceptions.java:138)\n\tat com.google.cloud.helix.common.Exceptions$Public.invalidInput(Exceptions.java:147)\n\tat com.google.cloud.helix.server.common.Validator$Check.fail(Validator.java:362)\n\tat com.google.cloud.helix.server.common.Validator$Check.check(Validator.java:351)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1652)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1641)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1590)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:1501)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:910)\n\tat com.google.cloud.helix.server.common.Validator.validate(Validator.java:890)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy$JobValidator.validate(HelixJobRosy.java:512)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy.insert(HelixJobRosy.java:903)\n\tat com.google.cloud.helix.server.rosy.HelixJobRosy.insert(HelixJobRosy.java:1488)\n\tat sun.reflect.GeneratedMethodAccessor1198.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$1.call(RosyRequestProxy.java:398)\n\tat com.google.cloud.helix.common.rosy.RosyRequestDapperHookFactory$TracingRequestHook.call(RosyRequestDapperHookFactory.java:83)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestVarzHookFactory$Hook.call(RosyRequestVarzHookFactory.java:232)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.server.rosy.RosyRequestAuditHookFactory$1.call(RosyRequestAuditHookFactory.java:39)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.server.rosy.RosyRequestContextHookFactory$1.call(RosyRequestContextHookFactory.java:66)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestCredsHookFactory$1.call(RosyRequestCredsHookFactory.java:44)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestStatsRequestHookFactory$Hook$1.call(RosyRequestStatsRequestHookFactory.java:82)\n\tat com.google.tracing.LocalTraceSpanCallable.call(LocalTraceSpanCallable.java:67)\n\tat com.google.tracing.LocalTraceSpanCallable.callWithNoException(LocalTraceSpanCallable.java:85)\n\tat com.google.tracing.LocalTraceSpanBuilder.callWithNoException(LocalTraceSpanBuilder.java:632)\n\tat com.google.cloud.helix.common.StatsRequestLog.startTrace(StatsRequestLog.java:41)\n\tat com.google.cloud.helix.common.rosy.RosyRequestStatsRequestHookFactory$Hook.call(RosyRequestStatsRequestHookFactory.java:79)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestLogHookFactory$1.call(RosyRequestLogHookFactory.java:56)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy$2.call(RosyRequestProxy.java:421)\n\tat com.google.cloud.helix.common.rosy.RosyRequestProxy.invoke(RosyRequestProxy.java:565)\n\tat com.sun.proxy.$Proxy27.insert(Unknown Source)\n\tat com.google.cloud.helix.proto.proto2api.HelixJob$HelixJobService$ServiceParameters$1.handleRequest(HelixJob.java:23875)\n\tat com.google.net.rpc3.impl.server.RpcServerInternalContext.runRpcInApplication(RpcServerInternalContext.java:565)\n\tat com.google.net.rpc3.impl.server.RpcServerChannel$1$1.runInContext(RpcServerChannel.java:875)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:314)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:446)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.CurrentContext.runInContext(CurrentContext.java:274)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:312)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n\nRequest served by: /10.73.99.130:4774/statusz\n\tat com.google.api.server.core.ErrorCollector.toFault(ErrorCollector.java:43)\n\tat com.google.api.server.rest.adapter.rosy.RosyErrorConverter.toFault(RosyErrorConverter.java:62)\n\tat com.google.api.server.rest.adapter.rosy.RosyHandler$2.call(RosyHandler.java:256)\n\tat com.google.api.server.rest.adapter.rosy.RosyHandler$2.call(RosyHandler.java:237)\n\tat com.google.api.server.core.util.CallableFuture.run(CallableFuture.java:62)\n\tat com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:439)\n\tat com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:903)\n\tat com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:814)\n\tat com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:656)\n\tat com.google.api.server.core.util.CallableFuture.run(CallableFuture.java:62)\n\tat com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:439)\n\tat com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:903)\n\tat com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:814)\n\tat com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:656)\n\tat com.google.api.server.core.util.CallableFuture.run(CallableFuture.java:62)\n\tat com.google.api.server.thread.ThreadTrackers$ThreadTrackingRunnable.run(ThreadTrackers.java:126)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:446)\n\tat com.google.api.server.server.CommonModule$ContextCarryingExecutorService$1.runInContext(CommonModule.java:801)\n\tat com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)\n\tat com.google.tracing.CurrentContext.runInContext(CurrentContext.java:274)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:312)\n\tat com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)\n\tat com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)\n\tat com.google.gse.internal.DispatchQueueImpl$WorkerThread.run(DispatchQueueImpl.java:400)\n"
} ],
"message" : "Invalid query parameter type"
}

最佳答案

查询参数类型名称必须采用规范的、完全大写的形式:“STRING”而不是“string”。

关于java - GoogleJsonResponseException : 400 Bad Request "Invalid query parameter type",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40484030/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com