예제 #1
0
파일: file.go 프로젝트: trythings/trythings
func (fc *FileConfig) populateLoadConfig(conf *bq.JobConfigurationLoad) {
	conf.SkipLeadingRows = fc.SkipLeadingRows
	conf.SourceFormat = string(fc.SourceFormat)
	conf.AllowJaggedRows = fc.AllowJaggedRows
	conf.AllowQuotedNewlines = fc.AllowQuotedNewlines
	conf.Encoding = string(fc.Encoding)
	conf.FieldDelimiter = fc.FieldDelimiter
	conf.IgnoreUnknownValues = fc.IgnoreUnknownValues
	conf.MaxBadRecords = fc.MaxBadRecords
	if fc.Schema != nil {
		conf.Schema = fc.Schema.asTableSchema()
	}
	conf.Quote = fc.quote()
}
예제 #2
0
파일: gcs.go 프로젝트: rizzles/convert
func (gcs *GCSReference) customizeLoadSrc(conf *bq.JobConfigurationLoad, projectID string) {
	conf.SourceUris = gcs.uris
	conf.SkipLeadingRows = gcs.SkipLeadingRows
	conf.SourceFormat = string(gcs.SourceFormat)
	conf.Encoding = string(gcs.Encoding)
	conf.FieldDelimiter = gcs.FieldDelimiter

	// TODO(mcgreevy): take into account gcs.ForceZeroQuote once the underlying library supports it.
	conf.Quote = gcs.Quote
}
예제 #3
0
파일: gcs.go 프로젝트: rawlingsj/gofabric8
func (gcs *GCSReference) customizeLoadSrc(conf *bq.JobConfigurationLoad) {
	conf.SourceUris = gcs.uris
	conf.SkipLeadingRows = gcs.SkipLeadingRows
	conf.SourceFormat = string(gcs.SourceFormat)
	conf.Encoding = string(gcs.Encoding)
	conf.FieldDelimiter = gcs.FieldDelimiter

	if gcs.ForceZeroQuote {
		quote := ""
		conf.Quote = &quote
	} else if gcs.Quote != "" {
		conf.Quote = &gcs.Quote
	}
}
예제 #4
0
func (t *Table) customizeLoadDst(conf *bq.JobConfigurationLoad, projectID string) {
	conf.DestinationTable = t.tableRefProto()
}
예제 #5
0
파일: load_op.go 프로젝트: nildev/account
func (opt ignoreUnknownValues) customizeLoad(conf *bq.JobConfigurationLoad, projectID string) {
	conf.IgnoreUnknownValues = true
}
예제 #6
0
파일: load_op.go 프로젝트: nildev/account
func (opt allowQuotedNewlines) customizeLoad(conf *bq.JobConfigurationLoad, projectID string) {
	conf.AllowQuotedNewlines = true
}
예제 #7
0
파일: load_op.go 프로젝트: nildev/account
func (opt allowJaggedRows) customizeLoad(conf *bq.JobConfigurationLoad, projectID string) {
	conf.AllowJaggedRows = true
}
예제 #8
0
파일: load_op.go 프로젝트: nildev/account
func (opt maxBadRecords) customizeLoad(conf *bq.JobConfigurationLoad, projectID string) {
	conf.MaxBadRecords = int64(opt)
}
예제 #9
0
파일: load_op.go 프로젝트: nildev/account
func (opt destSchema) customizeLoad(conf *bq.JobConfigurationLoad, projectID string) {
	conf.Schema = opt.asTableSchema()
}
예제 #10
0
func (opt TableCreateDisposition) customizeLoad(conf *bq.JobConfigurationLoad) {
	conf.CreateDisposition = string(opt)
}
예제 #11
0
func (opt allowQuotedNewlines) customizeLoad(conf *bq.JobConfigurationLoad) {
	conf.AllowQuotedNewlines = true
}
예제 #12
0
func (opt allowJaggedRows) customizeLoad(conf *bq.JobConfigurationLoad) {
	conf.AllowJaggedRows = true
}
예제 #13
0
func (opt maxBadRecords) customizeLoad(conf *bq.JobConfigurationLoad) {
	conf.MaxBadRecords = int64(opt)
}
예제 #14
0
func (opt destSchema) customizeLoad(conf *bq.JobConfigurationLoad) {
	conf.Schema = opt.asTableSchema()
}
예제 #15
0
func (t *Table) customizeLoadDst(conf *bq.JobConfigurationLoad, projectID string) {
	conf.DestinationTable = t.tableRefProto()
	conf.CreateDisposition = string(t.CreateDisposition)
	conf.WriteDisposition = string(t.WriteDisposition)
}
예제 #16
0
func (opt TableWriteDisposition) customizeLoad(conf *bq.JobConfigurationLoad, projectID string) {
	conf.WriteDisposition = string(opt)
}
예제 #17
0
func (opt ignoreUnknownValues) customizeLoad(conf *bq.JobConfigurationLoad) {
	conf.IgnoreUnknownValues = true
}
예제 #18
0
func (gcs *GCSReference) customizeLoadSrc(conf *bq.JobConfigurationLoad) {
	conf.SourceUris = gcs.uris
	conf.SkipLeadingRows = gcs.SkipLeadingRows
	conf.SourceFormat = string(gcs.SourceFormat)
	conf.AllowJaggedRows = gcs.AllowJaggedRows
	conf.AllowQuotedNewlines = gcs.AllowQuotedNewlines
	conf.Encoding = string(gcs.Encoding)
	conf.FieldDelimiter = gcs.FieldDelimiter
	conf.IgnoreUnknownValues = gcs.IgnoreUnknownValues
	conf.MaxBadRecords = gcs.MaxBadRecords
	if gcs.Schema != nil {
		conf.Schema = gcs.Schema.asTableSchema()
	}

	if gcs.ForceZeroQuote {
		quote := ""
		conf.Quote = &quote
	} else if gcs.Quote != "" {
		conf.Quote = &gcs.Quote
	}
}