embulk-plugin-input-sfdc-event-log-files 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26d4a69db8632348b043774556a10b3c7bbff8e3
4
- data.tar.gz: a2a7cfd359eb9a89625a4cc0f1bdd0229f236fc3
3
+ metadata.gz: f973162321b0974a1cc1dcca261ee3be8e2d9e4e
4
+ data.tar.gz: 6768787a20145071af909e2d3f63242eefe8357f
5
5
  SHA512:
6
- metadata.gz: d54660a917a3d419f3adef4a7f3cd9e3f7cd155323a04c3b26a6e3cdd0746c518793c1cca543a48caf9f0e5901cfa7b451a8eaefd84bd416a563aefdae5a8273
7
- data.tar.gz: 51b9b0c0724aa171876c611af1df816535a4a267dfb8286484413b97f05238693899bc11d277c8242ae5e956aceed1bc6087ecf4d049622b09e3860a69dd394d
6
+ metadata.gz: e0d3049dfcfcd0e23260769325d6358b971d976bc18dc7b1fd145ff15f530041c3bda31b30f30f4c383437dc4f62a6f447e93dbc031333ca41ac060c64f99795
7
+ data.tar.gz: bb6b96b8c4b21fbdb8807dd82bec0ee6b9fd6ff509a962f07d5047ffd97f161dd0ba4afa101547303150a1f25a3d6997ceed4d547dfd7a5a2e2e50e021a15395
data/README.md CHANGED
@@ -3,6 +3,6 @@ embulk-plugin-input-sfdc-event-log-files
3
3
 
4
4
  Embulk plugin for Salesforce.com Event Log Files input
5
5
 
6
- At this moment this plugin is a sample implementation of InputPlugin.
7
- Without GuessPlugin implementation you cannot create proper schema configuration.
8
- Stay tuned.
6
+ To extract EventLogFiles:
7
+ 1. check sample\_config.yml and edit OAuth ID, secret, username and password
8
+ 2. run embulk
@@ -33,9 +33,6 @@ module Embulk
33
33
 
34
34
  task['records'] = query(client, task)
35
35
 
36
- if schema.empty?
37
- raise 'empty schema given'
38
- end
39
36
  reports = yield(task, schema, threads)
40
37
  last_log_date_report = reports.max_by { |report|
41
38
  report['last_log_date']
@@ -98,7 +95,6 @@ module Embulk
98
95
  client = self.class.init_client(HTTPClient.new, task)
99
96
  records = task['records']
100
97
  last_log_date = Time.parse(task['last_log_date'])
101
- columns = schema.map { |c| c.name }
102
98
  records.each do |record|
103
99
  event_type = record['EventType']
104
100
  last_log_date = [last_log_date, Time.parse(record['LogDate']).to_i].max
@@ -106,13 +102,13 @@ module Embulk
106
102
  log_body = client.get_content(log_file)
107
103
  CSV.parse(log_body, headers: true) do |row|
108
104
  if row['TIMESTAMP']
109
- begin
110
- row['TIMESTAMP'] = Time.parse(row['TIMESTAMP']).to_i
111
- rescue
112
- # ignore
113
- end
105
+ row['time'] = Time.parse(row['TIMESTAMP']).to_i rescue nil
114
106
  end
115
- page_builder.add(row.to_hash.values_at(*columns).map(&:to_s))
107
+ page_builder.add(schema.map { |c|
108
+ v = row[c.name]
109
+ v = v.to_i if c.type == 'long'
110
+ v
111
+ })
116
112
  end
117
113
  end
118
114
  page_builder.finish unless records.empty?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-plugin-input-sfdc-event-log-files
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Nakamura