KEMBAR78
Sample UpdateViewQuery.java does not work. · Issue #1051 · googleapis/java-bigquery · GitHub
Skip to content

Sample UpdateViewQuery.java does not work. #1051

@dineshraj01

Description

@dineshraj01

I simply changed the dataset, tableName specific to my project and ran the class samples/snippets/src/main/java/com/example/bigquery/UpdateViewQuery.java.

It does not update the View query.

Reason I found.

ViewDefinition viewDefinition = viewMetadata.getDefinition();
viewDefinition.toBuilder().setQuery(query).build();

// Set metadata
bigquery.update(viewMetadata.toBuilder().setDefinition(viewDefinition).build());

The above code snippet creates a new ViewDefinition using the toBuilder() method but never really passes it to the bigquery.update() method. Old viewDefinition instance is passed. So the view query remains the same.

Is it intentional?

Metadata

Metadata

Labels

api: bigqueryIssues related to the googleapis/java-bigquery API.samplesIssues that are directly related to samples.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions