def test_versioned_collapsing_merge_tree(self):
        sign = Column('sign', types.Int8)
        version = Column('version', types.Int8)
        engine = engines.VersionedCollapsingMergeTree(
            sign, version, partition_by='x', order_by='x', primary_key='x'
        )

        with self._test_table(engine, sign, version) as (table, engine):
            self.assertIsInstance(engine, engines.VersionedCollapsingMergeTree)
            self.assertEqual(engine.sign_col.columns, [table.c.sign])
            self.assertEqual(engine.version_col.columns, [table.c.version])
            self.assertEqual(engine.partition_by.columns, [table.c.x])
            self.assertEqual(engine.order_by.columns, [table.c.x])
            self.assertEqual(engine.primary_key.columns, [table.c.x])
        class TestTable(self.base):
            date = Column(types.Date, primary_key=True)
            x = Column(types.Int32)
            y = Column(types.String)
            sign = Column(types.Int8)
            version = Column(types.Int8)

            __table_args__ = (engines.VersionedCollapsingMergeTree(
                sign,
                version,
                partition_by=date,
                order_by=(date, x),
                primary_key=(x, y),
                sample_by=func.random(),
                key='value'), )