Пример #1
0
def test_drop_partition(part_schema, table_name):
    stmt = ddl.DropPartition(
        table_name, {'year': 2007, 'month': 4}, part_schema
    )

    result = stmt.compile()
    expected = 'ALTER TABLE tbl DROP PARTITION (year=2007, month=4)'
    assert result == expected
Пример #2
0
 def drop_partition(self, spec):
     """Drop an existing table partition."""
     part_schema = self.partition_schema()
     stmt = ddl.DropPartition(self._qualified_name, spec, part_schema)
     return self._client.raw_sql(stmt)