logstash-output-charrington 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b4d2cf70c7a06e6c68ea07f630fe93193af889a40f86eb00f7939292c4e6c1a
4
- data.tar.gz: edb182ce54f06099fdb1bde09780584ca613ad0b4737b918d361491ec489cdbd
3
+ metadata.gz: 67301110645343eb9a0187da8a7c914cdba6ebe03241cea40ec757cc0972d61d
4
+ data.tar.gz: 753facf12027fd4a0c2d6a446835d060911aae52e74100b334ba6a277c37385c
5
5
  SHA512:
6
- metadata.gz: f0e1a050e254c82af0792545b20a0015d087058a2707c3c89e854f5fb573e4d08b3678ee41e9e60b0a3349f844d3e40e4faa8e1f07d7f3a36c2f718f7a916435
7
- data.tar.gz: 3435a5d501032182453784228a51c19b5bf67a46551ced92541b78ae97a4bab60a863c1c09922c7501d6e7a73816d6b96cdb1d64ed0700864f14fe940d48bdcc
6
+ metadata.gz: '0178367f4b8c91dff6da258005228ea8d473c7c6e550bcb03b6dd4e36a03f123a8ae83e96a7f91e8099c619f0fd7b3916388ba24741336881d2b3ff0c0c98733'
7
+ data.tar.gz: 16467a4fa971bc585e24cab322555239ba687daf77ece2839ad2e5d35ecf9af19463726261c7e4d31752a5771aee5881870fac3d61dbe887c8b0c6457caf6d95
@@ -35,19 +35,19 @@ module Charrington
35
35
  private
36
36
 
37
37
  def alter_table
38
- execute("ALTER TABLE #{schema}#{table_name} #{columns_fragment}")
38
+ execute_list(get_list_of_alter_table_stmts)
39
39
  end
40
40
 
41
- def columns_fragment
41
+ def get_list_of_alter_table_stmts
42
42
  column_types.map do |column|
43
- "ADD COLUMN #{column}"
44
- end.join(",")
43
+ "ALTER TABLE #{schema}#{table_name} ADD COLUMN #{column}"
44
+ end
45
45
  end
46
46
 
47
47
  def set_column_types
48
48
  (columns - current_table_columns).each_with_index do |key, idx|
49
49
  self.logger.info "New column: #{key}, because of event: #{event}"
50
-
50
+
51
51
  case event[key]
52
52
  when Time, LogStash::Timestamp
53
53
  column_types << "#{key} TIMESTAMP"
@@ -78,6 +78,15 @@ module Charrington
78
78
  stmt.close unless stmt.nil?
79
79
  end
80
80
 
81
+ def execute_list(list_of_sql_stmts)
82
+ self.logger.info "Received list of sql statments to execute: #{list_of_sql_stmts}"
83
+
84
+ list_of_sql_stmts.each_with_index do |sql, idx|
85
+ self.logger.info "Executing ALTER TABLE statement with index #{idx} and sql of: #{sql}"
86
+ execute(sql)
87
+ end
88
+ end
89
+
81
90
  def execute(sql)
82
91
  stmt = connection.prepareStatement(prep_sql(sql))
83
92
  stmt.execute()
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-charrington'
3
- s.version = '0.3.5'
3
+ s.version = '0.3.6'
4
4
 
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.homepage = 'https://gitlab.podium.com/engineering/analytics/logstash-output-charrington'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-charrington
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - dconger
@@ -182,6 +182,8 @@ files:
182
182
  - README.md
183
183
  - THANKS.md
184
184
  - lib/com/zaxxer/HikariCP/2.7.2/HikariCP-2.7.2.jar
185
+ - lib/commons-io/commons-io/2.4/commons-io-2.4.jar
186
+ - lib/de/flapdoodle/embed/de.flapdoodle.embed.process/2.0.2/de.flapdoodle.embed.process-2.0.2.jar
185
187
  - lib/logstash-output-charrington_jars.rb
186
188
  - lib/logstash/outputs/charrington.rb
187
189
  - lib/logstash/outputs/charrington/alter_postgres_table.rb
@@ -193,9 +195,16 @@ files:
193
195
  - lib/logstash/outputs/charrington/service.rb
194
196
  - lib/logstash/outputs/charrington/transform_postgres.rb
195
197
  - lib/logstash/outputs/charrington/transform_redshift.rb
198
+ - lib/net/java/dev/jna/jna-platform/4.0.0/jna-platform-4.0.0.jar
199
+ - lib/net/java/dev/jna/jna/4.0.0/jna-4.0.0.jar
200
+ - lib/org/apache/commons/commons-compress/1.10/commons-compress-1.10.jar
201
+ - lib/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar
196
202
  - lib/org/apache/logging/log4j/log4j-api/2.6.2/log4j-api-2.6.2.jar
197
203
  - lib/org/apache/logging/log4j/log4j-slf4j-impl/2.6.2/log4j-slf4j-impl-2.6.2.jar
204
+ - lib/org/postgresql/postgresql/42.2.5/postgresql-42.2.5.jar
198
205
  - lib/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar
206
+ - lib/ru/yandex/qatools/embed/postgresql-embedded/2.10/postgresql-embedded-2.10.jar
207
+ - lib/ru/yandex/qatools/embed/postgresql-embedded/2.8/postgresql-embedded-2.8.jar
199
208
  - logstash-output-charrington.gemspec
200
209
  - spec/charrington_spec_helper.rb
201
210
  - spec/logstash-output-charrington_test_jars.rb