当前位置: 首页>>代码示例>>Golang>>正文


Golang JobConfigurationQuery.UseQueryCache方法代码示例

本文整理汇总了Golang中google/golang.org/api/bigquery/v2.JobConfigurationQuery.UseQueryCache方法的典型用法代码示例。如果您正苦于以下问题:Golang JobConfigurationQuery.UseQueryCache方法的具体用法?Golang JobConfigurationQuery.UseQueryCache怎么用?Golang JobConfigurationQuery.UseQueryCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在google/golang.org/api/bigquery/v2.JobConfigurationQuery的用法示例。


在下文中一共展示了JobConfigurationQuery.UseQueryCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: populateJobQueryConfig

func (q *QueryConfig) populateJobQueryConfig(conf *bq.JobConfigurationQuery) error {
	conf.Query = q.Q

	if len(q.TableDefinitions) > 0 {
		conf.TableDefinitions = make(map[string]bq.ExternalDataConfiguration)
	}
	for name, data := range q.TableDefinitions {
		conf.TableDefinitions[name] = data.externalDataConfig()
	}

	if q.DefaultProjectID != "" || q.DefaultDatasetID != "" {
		conf.DefaultDataset = &bq.DatasetReference{
			DatasetId: q.DefaultDatasetID,
			ProjectId: q.DefaultProjectID,
		}
	}

	if tier := int64(q.MaxBillingTier); tier > 0 {
		conf.MaximumBillingTier = &tier
	}
	conf.CreateDisposition = string(q.CreateDisposition)
	conf.WriteDisposition = string(q.WriteDisposition)
	conf.AllowLargeResults = q.AllowLargeResults
	conf.Priority = string(q.Priority)

	f := false
	if q.DisableQueryCache {
		conf.UseQueryCache = &f
	}
	if q.DisableFlattenedResults {
		conf.FlattenResults = &f
		// DisableFlattenResults implies AllowLargeResults.
		conf.AllowLargeResults = true
	}
	if q.MaxBytesBilled >= 1 {
		conf.MaximumBytesBilled = q.MaxBytesBilled
	}
	if q.UseStandardSQL || len(q.Parameters) > 0 {
		conf.UseLegacySql = false
		conf.ForceSendFields = append(conf.ForceSendFields, "UseLegacySql")
	}

	if q.Dst != nil && !q.Dst.implicitTable() {
		conf.DestinationTable = q.Dst.tableRefProto()
	}
	for _, p := range q.Parameters {
		qp, err := p.toRaw()
		if err != nil {
			return err
		}
		conf.QueryParameters = append(conf.QueryParameters, qp)
	}
	return nil
}
开发者ID:trythings,项目名称:trythings,代码行数:54,代码来源:query.go

示例2: customizeQuery

func (opt useQueryCache) customizeQuery(conf *bq.JobConfigurationQuery, projectID string) {
	conf.UseQueryCache = true
}
开发者ID:rizzles,项目名称:convert,代码行数:3,代码来源:query_op.go

示例3: customizeQuery

func (opt disableQueryCache) customizeQuery(conf *bq.JobConfigurationQuery) {
	f := false
	conf.UseQueryCache = &f
}
开发者ID:rawlingsj,项目名称:gofabric8,代码行数:4,代码来源:query_op.go

示例4: customizeQuery

func (opt disableQueryCache) customizeQuery(conf *bq.JobConfigurationQuery, projectID string) {
	f := false
	conf.UseQueryCache = &f
}
开发者ID:nildev,项目名称:account,代码行数:4,代码来源:query_op.go


注:本文中的google/golang.org/api/bigquery/v2.JobConfigurationQuery.UseQueryCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。