Package com.google.cloud.bigquery
Class ViewDefinition
- java.lang.Object
-
- com.google.cloud.bigquery.TableDefinition
-
- com.google.cloud.bigquery.ViewDefinition
-
- All Implemented Interfaces:
Serializable
public abstract class ViewDefinition extends TableDefinition
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:
- Views, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ViewDefinition.Builder
-
Nested classes/interfaces inherited from class com.google.cloud.bigquery.TableDefinition
TableDefinition.Type
-
-
Constructor Summary
Constructors Constructor Description ViewDefinition()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
getQuery()
Returns the query used to create the view.List<UserDefinedFunction>
getUserDefinedFunctions()
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
of(String query)
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
toBuilder()
Returns a builder for theViewInfo
object.Boolean
useLegacySql()
Returns whether to use BigQuery's legacy SQL dialect for this query.-
Methods inherited from class com.google.cloud.bigquery.TableDefinition
getSchema, getType
-
-
-
-
Method Detail
-
getUserDefinedFunctions
public List<UserDefinedFunction> getUserDefinedFunctions()
Returns user defined functions that can be used bygetQuery()
. Returnsnull
if not set.- See Also:
- User-Defined Functions
-
useLegacySql
@Nullable public Boolean 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
public abstract ViewDefinition.Builder toBuilder()
Returns a builder for theViewInfo
object.- Specified by:
toBuilder
in classTableDefinition
-
newBuilder
public static ViewDefinition.Builder newBuilder(String query)
Returns a builder for a BigQuery view definition.- Parameters:
query
- the query used to generate the view
-
newBuilder
public static ViewDefinition.Builder newBuilder(String query, List<UserDefinedFunction> functions)
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
public static ViewDefinition.Builder newBuilder(String query, UserDefinedFunction... functions)
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
public static ViewDefinition of(String query)
Creates a BigQuery view definition given the query used to generate the table.- Parameters:
query
- the query used to generate the table
-
of
public static ViewDefinition of(String query, List<UserDefinedFunction> functions)
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
public static ViewDefinition of(String query, UserDefinedFunction... functions)
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
-
-