當前位置: 首頁>>代碼示例>>Golang>>正文


Golang v2.JobConfigurationExtract類代碼示例

本文整理匯總了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;未經允許,請勿轉載。