Package com.google.cloud.bigquery
Class ViewDefinition
java.lang.Object
com.google.cloud.bigquery.TableDefinition
com.google.cloud.bigquery.ViewDefinition
- All Implemented Interfaces:
Serializable
Google BigQuery view table definition. BigQuery's views are logical views, not materialized
views, which means that the query that defines the view is re-executed every time the view is
queried.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.cloud.bigquery.TableDefinition
TableDefinition.Type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
getQuery()
Returns the query used to create the view.Returns user defined functions that can be used bygetQuery()
.static ViewDefinition.Builder
newBuilder
(String query) Returns a builder for a BigQuery view definition.static ViewDefinition.Builder
newBuilder
(String query, UserDefinedFunction... functions) Returns a builder for a BigQuery view definition.static ViewDefinition.Builder
newBuilder
(String query, List<UserDefinedFunction> functions) Returns a builder for a BigQuery view definition.static ViewDefinition
Creates a BigQuery view definition given the query used to generate the table.static ViewDefinition
of
(String query, UserDefinedFunction... functions) Creates a BigQuery view definition given a query and some user-defined functions.static ViewDefinition
of
(String query, List<UserDefinedFunction> functions) Creates a BigQuery view definition given a query and some user-defined functions.abstract ViewDefinition.Builder
Returns a builder for theViewInfo
object.Returns whether to use BigQuery's legacy SQL dialect for this query.Methods inherited from class com.google.cloud.bigquery.TableDefinition
getSchema, getType
-
Constructor Details
-
ViewDefinition
public ViewDefinition()
-
-
Method Details
-
getQuery
Returns the query used to create the view. -
getUserDefinedFunctions
Returns user defined functions that can be used bygetQuery()
. Returnsnull
if not set.- See Also:
-
useLegacySql
Returns whether to use BigQuery's legacy SQL dialect for this query. By default this property is set tofalse
. If set tofalse
, the query will use BigQuery's Standard SQL. If set tonull
ortrue
, legacy SQL dialect is used. This property is experimental and might be subject to change. -
toBuilder
Returns a builder for theViewInfo
object.- Specified by:
toBuilder
in classTableDefinition
-
newBuilder
Returns a builder for a BigQuery view definition.- Parameters:
query
- the query used to generate the view
-
newBuilder
Returns a builder for a BigQuery view definition.- Parameters:
query
- the query used to generate the tablefunctions
- user-defined functions that can be used by the query
-
newBuilder
Returns a builder for a BigQuery view definition.- Parameters:
query
- the query used to generate the tablefunctions
- user-defined functions that can be used by the query
-
of
Creates a BigQuery view definition given the query used to generate the table.- Parameters:
query
- the query used to generate the table
-
of
Creates a BigQuery view definition given a query and some user-defined functions.- Parameters:
query
- the query used to generate the tablefunctions
- user-defined functions that can be used by the query
-
of
Creates a BigQuery view definition given a query and some user-defined functions.- Parameters:
query
- the query used to generate the tablefunctions
- user-defined functions that can be used by the query
-