You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add 'auto-detect schema' to bigquery snippet #2148
Add a Java example of loading files from Cloud Storage to BigQuery with the schema not specified, eg. what is 'auto-detect schema' in the BigQuery UI. Cannot find any documentation for this or code examples by way of Google.
Hey all -- it's been about 13 months since this issue was opened -- and it's a high hit for the Google Search on how to enable autodetection. I still can't see how to do this in the example snippets, or the documentation.
For anyone else who is coming across this issue with the same question -- here was my solution:
val tableId = TableId.of("my_dataset", "my_table_name")
val jobBuilder = LoadJobConfiguration.newBuilder(tableId, gcsUri)
jobBuilder.setAutodetect(true)
jobBuilder.setFormatOptions(FormatOptions.json())
val loadJobCfg = jobBuilder.build()
val loadJob = JobInfo.of(loadJobCfg)
Reacted by Tim Sweña (Swast), suchac and mizuno-keyence
Activity
garrettjonesgoogle commentedon Jul 17, 2017
cc @lesv @tswast
lesv commentedon Jul 19, 2017
@tswast Can you do this?
tswast commentedon Jul 19, 2017
Added to my backlog.
The gist is to set the
autodetectparameter on the LoadJobConfiguration. http://googlecloudplatform.github.io/google-cloud-java/0.20.2/apidocs/index.htmlP.S. The autodetect parameter is no longer "experimental" in the REST API. The JavaDocs should get updated.
garrettjonesgoogle commentedon Aug 10, 2017
Closing this out since @tswast is tracking it on his own backlog.
TJC commentedon Aug 3, 2018
Hey all -- it's been about 13 months since this issue was opened -- and it's a high hit for the Google Search on how to enable autodetection. I still can't see how to do this in the example snippets, or the documentation.
Any chance of a bump on this issue?
tswast commentedon Aug 3, 2018
@TJC thanks for the reminder. Yeah, I'll bump the priority.
TJC commentedon Aug 6, 2018
For anyone else who is coming across this issue with the same question -- here was my solution:
the-dagger commentedon Oct 12, 2018
Bumping this since it hasn't been added yet.
cc : @tswast
chore(main): release 2.38.1-SNAPSHOT (#2148)
deps: update dependency com.fasterxml.jackson.core:jackson-databind t…
chore(deps): update dependency com.google.cloud:google-cloud-pubsub t…
chore(deps): update dependency com.google.cloud:google-cloud-pubsub t…
chore(main): release 3.31.7 (#2148)
chore(deps): update dependency com.google.cloud:google-cloud-bigtable…