Class MaterializedViewDefinition.Builder (2.41.0) 
  
  
  
   
  
    
  
  
    
    
    
    
  Version 2.41.0keyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   abstract   static   class  MaterializedViewDefinition . Builder   extends   TableDefinition . Builder<MaterializedViewDefinition , MaterializedViewDefinition . Builder > 
  
  
  Constructors
   
  Builder() 
  
  Methods
   
  build() 
  
    
public   abstract   MaterializedViewDefinition   build ()  
  Creates a MaterializedViewDefinition object.
Overrides 
  
  setClustering(Clustering clustering) 
  
    
public   abstract   MaterializedViewDefinition . Builder   setClustering ( Clustering   clustering )  
  Set the clustering configuration for the materialized view. If not set, the materialized view
 is not clustered. BigQuery supports clustering for both partitioned and non-partitioned
 materialized views.
setEnableRefresh(Boolean enableRefresh) 
  
    
public   abstract   MaterializedViewDefinition . Builder   setEnableRefresh ( Boolean   enableRefresh )  
  Set enable automatic refresh of the materialized view when the base table is updated. The
 default value is "true".
    
      
        Parameter  
      
        Name Description  
      
        enableRefreshBoolean  
     
  
  
  setQuery(String query) 
  
    
public   abstract   MaterializedViewDefinition . Builder   setQuery ( String   query )  
  Sets the query whose result is persisted.
    
      
        Parameter  
      
        Name Description  
      
        queryString  
     
  
  
  setRangePartitioning(RangePartitioning rangePartitioning) 
  
    
public   abstract   MaterializedViewDefinition . Builder   setRangePartitioning ( RangePartitioning   rangePartitioning )  
  Sets the range partitioning configuration for the materialized view. Only one of
 timePartitioning and rangePartitioning should be specified.
setRefreshIntervalMs(Long refreshIntervalMs) 
  
    
public   abstract   MaterializedViewDefinition . Builder   setRefreshIntervalMs ( Long   refreshIntervalMs )  
  Set a maximum frequency at which this materialized view will be refreshed. The default value
 is "1800000" (30 minutes).
    
      
        Parameter  
      
        Name Description  
      
        refreshIntervalMsLong  
     
  
  
  setSchema(Schema schema) 
  
    
public   abstract   MaterializedViewDefinition . Builder   setSchema ( Schema   schema )  
  
  
    
      
        Parameter  
      
        Name Description  
      
        schemaSchema  
     
  
  
  Overrides 
  
  setTimePartitioning(TimePartitioning timePartitioning) 
  
    
public   abstract   MaterializedViewDefinition . Builder   setTimePartitioning ( TimePartitioning   timePartitioning )  
  Sets the time partitioning configuration for the materialized view. If not set, the
 materialized view is not time-partitioned.
setType(TableDefinition.Type type) 
  
    
public   abstract   MaterializedViewDefinition . Builder   setType ( TableDefinition . Type   type )  
  
  
  Overrides 
  
 
     
    
  
  
  
     
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-29 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-29 UTC."],[],[]]