@@ -68,44 +68,11 @@ def insert(self, event_or_events=None):
68
68
logging .debug ('class:%s insert %d rows' , __class__ , len (events ))
69
69
70
70
for event in events :
71
- schema = self .dst_schema if self .dst_schema else event .schema
72
- table = None
73
- if self .dst_distribute :
74
- table = TableProcessor .create_distributed_table_name (db = event .schema , table = event .table )
75
- else :
76
- table = self .dst_table if self .dst_table else event .table
77
- if self .dst_schema :
78
- table = TableProcessor .create_migrated_table_name (prefix = self .dst_table_prefix , table = table )
79
-
80
- sql = 'INSERT INTO `{0}`.`{1}` ({2}) FORMAT CSV' .format (
81
- schema ,
82
- table ,
83
- ', ' .join (map (lambda column : '`%s`' % column , event .fieldnames )),
84
- )
85
-
86
- choptions = ""
87
- if self .host :
88
- choptions += " --host=" + shlex .quote (self .host )
89
- if self .port :
90
- choptions += " --port=" + str (self .port )
91
- if self .user :
92
- choptions += " --user=" + shlex .quote (self .user )
93
- if self .password :
94
- choptions += " --password=" + shlex .quote (self .password )
95
- bash = "tail -n +2 '{0}' | clickhouse-client {1} --query='{2}'" .format (
96
- event .filename ,
97
- choptions ,
98
- sql ,
99
- )
100
-
101
- # logging.info('starting clickhouse-client process')
102
- # logging.debug('starting %s', bash)
103
- # os.system(bash)
104
-
105
- logging .info ('calling Tinybird' )
71
+ #schema = self.dst_schema if self.dst_schema else event.schema
72
+ #table = self.dst_table if self.dst_table else event.table
106
73
107
74
params = {
108
- 'name' : 'schedulings_ins' ,
75
+ 'name' : self . dst_table ,
109
76
'mode' : 'append'
110
77
}
111
78
token = 'p.eyJ1IjogIjUzMWUwMDUxLTRmZGQtNDc5MC05OGY0LWNlNTA3NDVkYzFkNSIsICJpZCI6ICIzNzMyOWExNy1mMGM2LTQyNWMtODhmOC1hZDE2MTU4OWIwNmMifQ.80_ZbRL9D8x2mlWay1EjdeA-zi7asxqKqp06NoOmadg'
0 commit comments