purplelight 0.1.3 → 0.1.4
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 +4 -4
- data/LICENSE +21 -0
- data/README.md +1 -1
- data/lib/purplelight/snapshot.rb +2 -2
- data/lib/purplelight/version.rb +1 -1
- data/lib/purplelight/writer_csv.rb +2 -2
- data/lib/purplelight/writer_jsonl.rb +2 -2
- metadata +2 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 707f5c45aade0603b8a3c500e91015b9850c2c92deb91492f06cb3f8bbee76d5
|
4
|
+
data.tar.gz: dd6217a55fa5bcd3f008699bd8710e8e0ac72f9bb0b8bf5dd71d2f2eccbc5d84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23da05fd59362787069ae1df5168d85c210d2c7cfc0fd254c064cae26212ee177b84dff8c72ba825a612b3aef3072188e54fad267c60331105dc026e96b42d50
|
7
|
+
data.tar.gz: 8b8a728f0002f60d55c31270ee2751aaddab422777aa2a51d6a8b8d3a25a93fe2be27d218316b6fd077103d2901f7561b4983a27a27fde895b80fdc6ee67089f
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Alexander Nicholson
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
data/lib/purplelight/snapshot.rb
CHANGED
@@ -203,12 +203,12 @@ module Purplelight
|
|
203
203
|
last_id = doc['_id']
|
204
204
|
doc = @mapper.call(doc) if @mapper
|
205
205
|
if encode_lines
|
206
|
-
line = "#{
|
206
|
+
line = "#{JSON.generate(doc)}\n"
|
207
207
|
bytes = line.bytesize
|
208
208
|
buffer << line
|
209
209
|
else
|
210
210
|
# For CSV/Parquet keep raw docs to allow schema/row building
|
211
|
-
bytes = (
|
211
|
+
bytes = (JSON.generate(doc).bytesize + 1)
|
212
212
|
buffer << doc
|
213
213
|
end
|
214
214
|
buffer_bytes += bytes
|
data/lib/purplelight/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'csv'
|
4
|
-
require '
|
4
|
+
require 'json'
|
5
5
|
require 'zlib'
|
6
6
|
require 'fileutils'
|
7
7
|
|
@@ -173,7 +173,7 @@ module Purplelight
|
|
173
173
|
val = doc[key] || doc[key.to_sym]
|
174
174
|
case val
|
175
175
|
when Hash, Array
|
176
|
-
|
176
|
+
JSON.generate(val)
|
177
177
|
else
|
178
178
|
val
|
179
179
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'json'
|
4
4
|
require 'zlib'
|
5
5
|
require 'fileutils'
|
6
6
|
|
@@ -44,7 +44,7 @@ module Purplelight
|
|
44
44
|
buffer = if array_of_docs.first.is_a?(String)
|
45
45
|
array_of_docs.join
|
46
46
|
else
|
47
|
-
array_of_docs.map { |doc| "#{
|
47
|
+
array_of_docs.map { |doc| "#{JSON.generate(doc)}\n" }.join
|
48
48
|
end
|
49
49
|
rows = array_of_docs.size
|
50
50
|
write_buffer(buffer)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: purplelight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Nicholson
|
@@ -51,20 +51,6 @@ dependencies:
|
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '2.19'
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
name: oj
|
56
|
-
requirement: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '3.16'
|
61
|
-
type: :runtime
|
62
|
-
prerelease: false
|
63
|
-
version_requirements: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '3.16'
|
68
54
|
description: High-throughput, resumable snapshots of MongoDB collections with partitioning,
|
69
55
|
multi-threaded readers, and size-based sharded outputs.
|
70
56
|
email:
|
@@ -74,6 +60,7 @@ executables:
|
|
74
60
|
extensions: []
|
75
61
|
extra_rdoc_files: []
|
76
62
|
files:
|
63
|
+
- LICENSE
|
77
64
|
- README.md
|
78
65
|
- Rakefile
|
79
66
|
- bin/purplelight
|