def create_table_sql()

in dbt/adapters/maxcompute/relation_configs/_materialized_view.py [0:0]


    def create_table_sql(self) -> str:
        sql = f"CREATE MATERIALIZED VIEW IF NOT EXISTS {self.get_coordinate()}\n"
        if self.lifecycle and self.lifecycle > 0:
            sql += f"LIFECYCLE {self.lifecycle}\n"
        if self.build_deferred:
            sql += "BUILD DEFERRED\n"
        if self.columns and len(self.columns) > 0:
            sql += "("
            for column in self.columns:
                if self.column_comment and column in self.column_comment:
                    sql += (
                        f"{quote_ref(column)} COMMENT {quote_string(self.column_comment[column])}"
                    )
                else:
                    sql += f"{quote_ref(column)}"
                sql += ", "
            sql = sql[:-2]
            sql += ")\n"
        if self.disable_rewrite:
            sql += " DISABLE REWRITE\n"
        if self.table_comment:
            sql += f"COMMENT {quote_string(self.table_comment)}\n"
        if self.partition_by and len(self.partition_by.fields) > 0:
            sql += f"PARTITIONED BY({self.partition_by.render(False)})\n"
        if self.tblProperties and len(self.tblProperties) > 0:
            sql += "TBLPROPERTIES( "
            for k, v in self.tblProperties.items():
                sql += f'"{k}"="{v}", '
            sql = sql[:-2]
            sql += ")\n"
        return sql