mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 09:06:41 +03:00
Fix for create_table_sql for Buffer table
This commit is contained in:
parent
c9697de56c
commit
d19787cb9f
|
@ -80,11 +80,11 @@ class Buffer(Engine):
|
|||
self.max_bytes = max_bytes
|
||||
|
||||
|
||||
def create_table_sql(self, db_name, target):
|
||||
def create_table_sql(self, db_name, main_model):
|
||||
# Overriden create_table_sql example:
|
||||
#sql = 'ENGINE = Buffer(merge, hits, 16, 10, 100, 10000, 1000000, 10000000, 100000000)'
|
||||
sql = 'ENGINE = Buffer(%s, %s, %d, %d, %d, %d, %d, %d, %d)' % (
|
||||
db_name, target.table_name(), self.num_layers,
|
||||
db_name, main_model.table_name(), self.num_layers,
|
||||
self.min_time, self.max_time, self.min_rows,
|
||||
self.max_rows, self.min_bytes, self.max_bytes
|
||||
)
|
||||
|
|
|
@ -168,6 +168,6 @@ class BufferModel(Model):
|
|||
Returns the SQL command for creating a table for this model.
|
||||
'''
|
||||
parts = ['CREATE TABLE IF NOT EXISTS `%s`.`%s` AS `%s`.`%s`' % (db_name, cls.table_name(), db_name, cls.main_model.table_name())]
|
||||
engine_str = cls.engine.create_table_sql(db_name, cls)
|
||||
engine_str = cls.engine.create_table_sql(db_name, cls.main_model)
|
||||
parts.append(engine_str)
|
||||
return ' '.join(parts)
|
||||
|
|
Loading…
Reference in New Issue
Block a user