multiwoven-integrations 0.18.1 → 0.18.2

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: 5e47af6ddbbd4a1e2e19639fc52439083c966be41493c119abcb27650e575bdb
4
- data.tar.gz: 9850fe744b19bcc2fe9c043b009e4c2e7563b8005b489183de5e1ae76f5fda7d
3
+ metadata.gz: 872d35288639a0863bbe3e91a7413fd19194a60059155231c3afeb5bcc5710b4
4
+ data.tar.gz: f3237a02c7905a654a14074879215722bd9fc46fb62a5508a0511fd9dff2123e
5
5
  SHA512:
6
- metadata.gz: 18d90e4e8be760704494b76ad1442d618afc9c48c2e7ea376ffd48a36cf453618783801325f1660a441dbf69e3f2f63f606a96209461f9bcf28355cc8f636f15
7
- data.tar.gz: fbf22e1d8bf4df45131d61babe38feaadad34d23be924685a7c560cbcb109477e7f78761b180b60ee5ca8c78b31a35e3ecc193f9476826cf2ad13cf3203500a4
6
+ metadata.gz: aeebc66382aaf4c99c92940e7011a8f0f13fee3ade624e0e93ba98cd8c652368f90e485a92f4e1c526f543dc49beb48469d5642c1d86ab8e17fce14ee50521e7
7
+ data.tar.gz: 918f48630ce40ad37f0fd86bae8708a18646bc531abe88a844ae18c2ce06b759b942da4fd7c45947384df27629e733eab4288739eb611e3904efd22e2385a084
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.18.1"
5
+ VERSION = "0.18.2"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -86,15 +86,9 @@ module Multiwoven::Integrations::Source
86
86
  end
87
87
 
88
88
  def query(conn, query)
89
- query_regex = /\ASELECT\s+(?<columns>[\w,\s]+)\s+FROM\s+\w+\s*(?:LIMIT\s+(?<limit>\d+))?\s*(?:OFFSET\s+(?<offset>\d+))?\z/i
90
- match = query.match(query_regex)
91
- columns = match[:columns] || "*"
92
- offset = match[:offset].to_i || 0
93
- limit = match[:limit]&.to_i || nil
94
89
  @sftp.download!(@remote_file_path, @tempfile.path)
95
- adjusted_query = "SELECT #{columns} FROM read_csv_auto('#{@tempfile.path}') OFFSET #{offset}"
96
- adjusted_query += " LIMIT #{limit}" if limit
97
- records = get_results(conn, adjusted_query)
90
+ query = query.gsub(/FROM\s+\S+/i, "FROM read_csv_auto('#{@tempfile.path}')") if query.match?(/\bFROM\b/i)
91
+ records = get_results(conn, query)
98
92
  records.map do |row|
99
93
  RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_multiwoven_message
100
94
  end
@@ -4,7 +4,7 @@
4
4
  "connection_specification": {
5
5
  "$schema": "http://json-schema.org/draft-07/schema#",
6
6
  "title": "SFTP",
7
- "required": ["host", "username", "password", "file_path", "format_type" ],
7
+ "required": ["host", "username", "password", "file_path", "file_name", "format_type" ],
8
8
  "properties": {
9
9
  "host": {
10
10
  "title": "Host",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P