databricks 2.1.0 → 2.2.0

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: 5180797f8cb0ab700566b70bbb20fe1e54a46241162a2efc7c128846998aaaf4
4
- data.tar.gz: 910d6984b316a2b09b90a94ae267e157aadc7197aa5f897bd50b2a5b21e21da2
3
+ metadata.gz: 4fa10746d84fcd9135f2b811ae8f48509fde3ef567fa87b914c337a0881d7e9e
4
+ data.tar.gz: 8cedbeb212e416c99d84fc0f5f53ec609e0510f021af5142c550a7272d0b1a79
5
5
  SHA512:
6
- metadata.gz: da5dcd7a5f419079a845c43fe2c4f3d073351abad9c5f8313d826124389c5d801bf528622ef06bdb81ca58d41bdd341d0487dfa0740632d1a50162548b263324
7
- data.tar.gz: 8d850d1cabacf5c325ee094560473055c14da9278cc5d4412b3a85ae2fbd914c01ede639458db3ffab9ba3fb8001e174bbc326a7aaf2b86421141d3d3b24d065
6
+ metadata.gz: 18cda5b9682e863158015c018fa1941b135421feac1361c6a8714dd51d82f484010d7cce4538d9dd04fcd91f494c486a78ba155824e9c1dcede212849a45730a
7
+ data.tar.gz: dd5c5fea89ab21a638e88ea16665722457fbfa2d48811f7cdba6228927a2293338611003a611b1880035c5f5782911d200f7ce954f21c3bfd41c487107799bdd
@@ -1,3 +1,5 @@
1
+ require 'base64'
2
+
1
3
  module Databricks
2
4
 
3
5
  module Resources
@@ -47,6 +49,28 @@ module Databricks
47
49
  )
48
50
  end
49
51
 
52
+ # Read a file.
53
+ # Decodes the content in the json response (that is originally Base64-encoded).
54
+ #
55
+ # Parameters::
56
+ # * *path* (String): Path to the file to read
57
+ # * *offset* (Integer): Offset to read from [default: 0]
58
+ # * *length* (Integer): Number of nytes to read from (max 1MB) [default: 524_288]
59
+ def read(path, offset: 0, length: 524_288)
60
+ raw_json = get_json(
61
+ 'dbfs/read',
62
+ {
63
+ path: path,
64
+ offset: offset,
65
+ length: length
66
+ }
67
+ )
68
+ {
69
+ 'bytes_read' => raw_json['bytes_read'],
70
+ 'data' => Base64.decode64(raw_json['data'])
71
+ }
72
+ end
73
+
50
74
  end
51
75
 
52
76
  end
@@ -1,5 +1,5 @@
1
1
  module Databricks
2
2
 
3
- VERSION = '2.1.0'
3
+ VERSION = '2.2.0'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: databricks
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2021-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubygems_version: 3.2.3
108
+ rubygems_version: 3.2.15
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Rubygem wrapping the Databricks REST API