本文整理汇总了Golang中google/golang.org/api/bigquery/v2.JobConfigurationExtract类的典型用法代码示例。如果您正苦于以下问题:Golang JobConfigurationExtract类的具体用法?Golang JobConfigurationExtract怎么用?Golang JobConfigurationExtract使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JobConfigurationExtract类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: customizeExtractDst
func (gcs *GCSReference) customizeExtractDst(conf *bq.JobConfigurationExtract) {
conf.DestinationUris = gcs.uris
conf.Compression = string(gcs.Compression)
conf.DestinationFormat = string(gcs.DestinationFormat)
conf.FieldDelimiter = gcs.FieldDelimiter
}
开发者ID:rawlingsj,项目名称:gofabric8,代码行数:6,代码来源:gcs.go
示例2: customizeExtractSrc
func (t *Table) customizeExtractSrc(conf *bq.JobConfigurationExtract, projectID string) {
conf.SourceTable = t.tableRefProto()
}
开发者ID:hsinhoyeh,项目名称:gcloud-golang,代码行数:3,代码来源:table.go
示例3: main
func main() {
flag.Parse()
// setEnvVars()
client, err := GoogleClient()
if err == nil {
bq, _ := bigquery.New(client)
dsr := new(bigquery.DatasetReference)
dsr.DatasetId = *bqSourceDataset
dsr.ProjectId = *bqSourceProject
// request := new(bigquery.QueryRequest)
// request.DefaultDataset = dsr
// request.Query = "SELECT count(*) FROM []"
// call := bq.Jobs.Query("", request)
// resp, err := call.Do()
// jobs := new(bigquery.JobsService)
// job := jobs.Query("sapient-catbird-547", request)
// resp, err := job.Do()
// fmt.Print(resp.CacheHit, resp.JobReference, err)
// jobId := resp.JobReference.JobId
// s, _ := bq.Jobs.GetQueryResults("", jobId).Do()
// buf, _ := json.Marshal(s)
// fmt.Println(s, string(buf), "\n\n\n")
tabr := new(bigquery.TableReference)
tabr.DatasetId = *bqDestDataset
tabr.ProjectId = *bqDestProject
tabr.TableId = "temp_grouped_v2"
// jcq := new(bigquery.JobConfigurationQuery)
// jcq.DestinationTable = tabr
// jcq.Priority = "BATCH"
// jcq.WriteDisposition = "WRITE_TRUNCATE"
// jcq.Query = "SELECT ap_mac, COUNT(DISTINCT(client_mac)), DATE(TIMESTAMP(first_seen)) date FROM [dev_sense_v1.sensev4_ct] GROUP BY ap_mac, date"
// jc := new(bigquery.JobConfiguration)
// jc.Query = jcq
// job := new(bigquery.Job)
// job.Configuration = jc
// aa, err := bq.Jobs.Insert(*bqSourceProject, job).Do()
// if err == nil {
// fmt.Print(aa.Id)
// } else {
// fmt.Print(err)
// }
jce := new(bigquery.JobConfigurationExtract)
jce.DestinationFormat = "csv"
jce.DestinationUri = "gs://ct_temp/151028.csv"
jce.SourceTable = tabr
extractJc := new(bigquery.JobConfiguration)
extractJc.Extract = jce
extractJob := new(bigquery.Job)
extractJob.Configuration = extractJc
aa, err := bq.Jobs.Insert(*bqSourceProject, extractJob).Do()
if err == nil {
fmt.Print(aa.Id)
} else {
fmt.Print(err)
}
}
}
开发者ID:PolkaSpots,项目名称:analytics,代码行数:76,代码来源:main.go
示例4: customizeExtract
func (opt disableHeader) customizeExtract(conf *bq.JobConfigurationExtract, projectID string) {
conf.PrintHeader = false
}
开发者ID:rizzles,项目名称:convert,代码行数:3,代码来源:extract_op.go
示例5: customizeExtract
func (opt disableHeader) customizeExtract(conf *bq.JobConfigurationExtract) {
f := false
conf.PrintHeader = &f
}
开发者ID:rawlingsj,项目名称:gofabric8,代码行数:4,代码来源:extract_op.go
注:本文中的google/golang.org/api/bigquery/v2.JobConfigurationExtract类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论