mkpipe-extractor-sqlserver 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,436 @@
1
+ import os
2
+ import datetime
3
+ from pathlib import Path
4
+ from urllib.parse import quote_plus
5
+ from pyspark.sql import SparkSession
6
+ from pyspark import SparkConf
7
+ import pyspark.sql.functions as F
8
+
9
+ from mkpipe.config import load_config
10
+ from mkpipe.utils import log_container, Logger
11
+ from mkpipe.functions_db import get_db_connector
12
+ from mkpipe.utils.base_class import PipeSettings
13
+ from mkpipe.plugins.registry_jar import collect_jars
14
+
15
+
16
+ class SqlserverExtractor:
17
+ def __init__(self, config, settings):
18
+ if isinstance(settings, dict):
19
+ self.settings = PipeSettings(**settings)
20
+ else:
21
+ self.settings = settings
22
+ self.connection_params = config['connection_params']
23
+ self.host = self.connection_params['host']
24
+ self.port = self.connection_params['port']
25
+ self.username = self.connection_params['user']
26
+ # self.password = quote_plus(str(self.connection_params['password']))
27
+ self.password = str(self.connection_params['password'])
28
+ self.database = self.connection_params['database']
29
+
30
+ self.driver_name = 'sqlserver'
31
+ self.driver_jdbc = 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
32
+ self.settings.driver_name = self.driver_name
33
+ self.jdbc_url = f'jdbc:{self.driver_name}://{self.host}:{self.port};databaseName={self.database};user={self.username};password={self.password};encrypt=false;trustServerCertificate=false'
34
+
35
+ config = load_config()
36
+ connection_params = config['settings']['backend']
37
+ db_type = connection_params['database_type']
38
+ self.backend = get_db_connector(db_type)(connection_params)
39
+
40
+ def create_spark_session(self):
41
+ jars = collect_jars()
42
+ conf = SparkConf()
43
+ conf.setAppName(__file__)
44
+ conf.setMaster('local[*]')
45
+ conf.set('spark.driver.memory', self.settings.spark_driver_memory)
46
+ conf.set('spark.executor.memory', self.settings.spark_executor_memory)
47
+ conf.set('spark.jars', jars)
48
+ conf.set('spark.driver.extraClassPath', jars)
49
+ conf.set('spark.executor.extraClassPath', jars)
50
+ conf.set('spark.network.timeout', '600s')
51
+ conf.set('spark.sql.parquet.datetimeRebaseModeInRead', 'CORRECTED')
52
+ conf.set('spark.sql.parquet.datetimeRebaseModeInWrite', 'CORRECTED')
53
+ conf.set('spark.sql.parquet.int96RebaseModeInRead', 'CORRECTED')
54
+ conf.set('spark.sql.parquet.int96RebaseModeInWrite', 'CORRECTED')
55
+ conf.set('spark.sql.session.timeZone', self.settings.timezone)
56
+ conf.set(
57
+ 'spark.driver.extraJavaOptions', f'-Duser.timezone={self.settings.timezone}'
58
+ )
59
+ conf.set(
60
+ 'spark.executor.extraJavaOptions',
61
+ f'-Duser.timezone={self.settings.timezone}',
62
+ )
63
+ conf.set(
64
+ 'spark.driver.extraJavaOptions',
65
+ '-XX:ErrorFile=/tmp/java_error%p.log -XX:HeapDumpPath=/tmp',
66
+ )
67
+
68
+ return SparkSession.builder.config(conf=conf).getOrCreate()
69
+
70
+ def extract_incremental(self, t):
71
+ logger = Logger(__file__)
72
+ spark = self.create_spark_session()
73
+
74
+ try:
75
+ name = t['name']
76
+ target_name = t['target_name']
77
+ iterate_column_type = t['iterate_column_type']
78
+ iterate_batch_size = t.get(
79
+ 'iterate_batch_size', self.settings.default_iterate_batch_size
80
+ )
81
+ iterate_max_loop = t.get(
82
+ 'iterate_max_loop', self.settings.default_iterate_max_loop
83
+ )
84
+ custom_query = t.get('custom_query', None)
85
+ custom_query_file = t.get('custom_query_file', None)
86
+ if custom_query_file:
87
+ custom_query_file_path = os.path.abspath(
88
+ os.path.join(self.settings.ROOT_DIR, 'sql', custom_query_file)
89
+ )
90
+ with open(custom_query_file_path, 'r') as f:
91
+ custom_query = f.read()
92
+
93
+ custom_partition_count = t.get(
94
+ 'partition_count', self.settings.partitions_count
95
+ )
96
+ partitions_column_ = t.get('partitions_column')
97
+ fetchsize = t.get('fetchsize', 100_000)
98
+
99
+ partitions_column = partitions_column_.split(' as ')[0].strip()
100
+ p_col_name = partitions_column_.split(' as ')[-1].strip()
101
+ p_col_select = f'{partitions_column} as {p_col_name}'
102
+
103
+ message = dict(table_name=target_name, status='extracting')
104
+ logger.info(message)
105
+ parquet_path = os.path.abspath(
106
+ os.path.join(self.settings.ROOT_DIR, 'artifacts', target_name)
107
+ )
108
+
109
+ last_point = self.backend.get_last_point(target_name)
110
+ if last_point:
111
+ write_mode = 'append'
112
+
113
+ iterate_query = f"""(SELECT {p_col_select} from {name} where {partitions_column} > '{last_point}' ) q"""
114
+
115
+ df_itarate_list = (
116
+ spark.read.format('jdbc')
117
+ .option('url', self.jdbc_url)
118
+ .option('dbtable', iterate_query)
119
+ .option('driver', self.driver_jdbc)
120
+ .option('fetchsize', fetchsize)
121
+ .load()
122
+ )
123
+
124
+ min_val = last_point
125
+ max_val = df_itarate_list.agg(F.max(p_col_name).alias('max')).collect()[
126
+ 0
127
+ ][0]
128
+ df_itarate_list = df_itarate_list.where(F.col(p_col_name) > min_val)
129
+ else:
130
+ write_mode = 'overwrite'
131
+
132
+ iterate_query = f'(SELECT {p_col_select} from {name}) q'
133
+ df_itarate_list = (
134
+ spark.read.format('jdbc')
135
+ .option('url', self.jdbc_url)
136
+ .option('dbtable', iterate_query)
137
+ .option('driver', self.driver_jdbc)
138
+ .option('fetchsize', fetchsize)
139
+ .load()
140
+ )
141
+
142
+ min_max_vals = df_itarate_list.agg(
143
+ F.min(p_col_name).alias('min'), F.max(p_col_name).alias('max')
144
+ ).collect()[0]
145
+ min_val = min_max_vals[0]
146
+ max_val = min_max_vals[1]
147
+ df_itarate_list = df_itarate_list.where(F.col(p_col_name) >= min_val)
148
+
149
+ key_list = (
150
+ df_itarate_list.select(p_col_name)
151
+ .distinct()
152
+ .rdd.flatMap(lambda x: x)
153
+ .collect()
154
+ )
155
+ key_list.sort()
156
+
157
+ chunks = [
158
+ key_list[x : x + iterate_batch_size]
159
+ for x in range(0, len(key_list), iterate_batch_size)
160
+ ]
161
+
162
+ min_max_tuple = [(min(x), max(x)) for x in chunks]
163
+
164
+ if not min_max_tuple:
165
+ if not last_point:
166
+ # Empty table, need schema fetc
167
+ return self.extract_full(t)
168
+ else:
169
+ # Not empt, but no new data, all fetched before
170
+ data = {
171
+ 'table_name': target_name,
172
+ 'status': 'extracted',
173
+ 'replication_method': 'incremental',
174
+ }
175
+ return data
176
+
177
+ data = {
178
+ 'table_name': target_name,
179
+ 'write_mode': write_mode,
180
+ 'file_type': 'parquet',
181
+ 'partition_count': custom_partition_count,
182
+ 'fetchsize': fetchsize,
183
+ 'last_point_value': None, # Initialize as None or the starting value
184
+ 'iterate_column_type': iterate_column_type,
185
+ 'loop': None, # This will be updated each loop
186
+ 'path': parquet_path,
187
+ 'number_of_columns': None,
188
+ 'number_of_rows': 0, # Start with 0 and add to it in each loop
189
+ 'pass_on_error': self.pass_on_error,
190
+ 'status': 'extracted',
191
+ 'replication_method': 'incremental',
192
+ }
193
+
194
+ for index, chunk in enumerate(min_max_tuple):
195
+ if iterate_max_loop == index:
196
+ break
197
+
198
+ if index == 0:
199
+ p_write_mode = 'overwrite'
200
+ else:
201
+ p_write_mode = 'append'
202
+
203
+ if iterate_column_type == 'int':
204
+ min_filter = int(chunk[0])
205
+ max_filter = int(chunk[-1])
206
+ if custom_query:
207
+ updated_query = custom_query.replace(
208
+ '{query_filter}',
209
+ f""" where {partitions_column} between {min_filter} and {max_filter} """,
210
+ )
211
+ else:
212
+ updated_query = f'(SELECT * from {name} where {partitions_column} between {min_filter} and {max_filter}) q'
213
+ else:
214
+ min_filter = str(chunk[0])
215
+ max_filter = str(chunk[-1])
216
+ if custom_query:
217
+ updated_query = custom_query.replace(
218
+ '{query_filter}',
219
+ f""" where {partitions_column} between '{min_filter}' and '{max_filter}' """,
220
+ )
221
+ else:
222
+ updated_query = f"""(SELECT * from {name} where {partitions_column} between '{min_filter}' and '{max_filter}') q"""
223
+
224
+ df = (
225
+ spark.read.format('jdbc')
226
+ .option('url', self.jdbc_url)
227
+ .option('dbtable', updated_query)
228
+ .option('driver', self.driver_jdbc)
229
+ .option('numPartitions', custom_partition_count)
230
+ .option('partitionColumn', p_col_name)
231
+ .option('lowerBound', min_val)
232
+ .option('upperBound', max_val)
233
+ .option('fetchsize', fetchsize)
234
+ .load()
235
+ )
236
+
237
+ # df.filter(df.cust_ord_id == 285708).select("udate").show(truncate=False)
238
+ # df = df.dropDuplicates() # this process affecting the partition_count be careful
239
+ (
240
+ df.write.option('compression', self.settings.compression_codec)
241
+ .mode(p_write_mode)
242
+ .parquet(parquet_path)
243
+ )
244
+ count_col = len(df.columns)
245
+ count_row = df.count()
246
+ last_point_value = max_filter
247
+
248
+ # Update `data` for this iteration
249
+ data['last_point_value'] = last_point_value # update with the new max
250
+ data['loop'] = index # update loop index
251
+ data['number_of_columns'] = count_col
252
+ data['number_of_rows'] += (
253
+ count_row # add current loop's row count to the cumulative total
254
+ )
255
+
256
+ message = dict(
257
+ table_name=target_name,
258
+ status='iterrated',
259
+ meta_data=data,
260
+ )
261
+ logger.info(message)
262
+ logger.info(data)
263
+ return data
264
+ finally:
265
+ # Ensure Spark session is closed
266
+ spark.stop()
267
+
268
+ def extract_full(self, t):
269
+ logger = Logger(__file__)
270
+ spark = self.create_spark_session()
271
+ try:
272
+ name = t['name']
273
+ target_name = t['target_name']
274
+ message = dict(table_name=target_name, status='extracting')
275
+ logger.info(message)
276
+ custom_partition_count = t.get(
277
+ 'partition_count', self.settings.partitions_count
278
+ )
279
+ fetchsize = t.get('fetchsize', 100_000)
280
+ partitions_column_ = t.get('partitions_column', None)
281
+
282
+ custom_query = t.get('custom_query', None)
283
+ custom_query_file = t.get('custom_query_file', None)
284
+ if custom_query_file:
285
+ custom_query_file_path = os.path.abspath(
286
+ os.path.join(self.settings.ROOT_DIR, 'sql', custom_query_file)
287
+ )
288
+ with open(custom_query_file_path, 'r') as f:
289
+ custom_query = f.read()
290
+
291
+ write_mode = 'overwrite'
292
+ parquet_path = os.path.abspath(
293
+ os.path.join(self.settings.ROOT_DIR, 'artifacts', target_name)
294
+ )
295
+
296
+ if not custom_query:
297
+ updated_query = f'(SELECT * from {name}) q'
298
+ else:
299
+ updated_query = custom_query.replace(
300
+ '{query_filter}',
301
+ ' where 1=1 ',
302
+ )
303
+
304
+ if partitions_column_:
305
+ partitions_column = partitions_column_.split(' as ')[0]
306
+ p_col_name = partitions_column_.split(' as ')[-1]
307
+ query_min_max = f'(SELECT min({partitions_column}), max({partitions_column}) from {name}) q'
308
+ df_min_max = (
309
+ spark.read.format('jdbc')
310
+ .option('url', self.jdbc_url)
311
+ .option('dbtable', query_min_max)
312
+ .option('driver', self.driver_jdbc)
313
+ .option('fetchsize', fetchsize)
314
+ .load()
315
+ )
316
+
317
+ min_val = df_min_max.first()['min']
318
+ max_val = df_min_max.first()['max']
319
+
320
+ if min_val:
321
+ # which means table not empt
322
+ df = (
323
+ spark.read.format('jdbc')
324
+ .option('url', self.jdbc_url)
325
+ .option('dbtable', updated_query)
326
+ .option('driver', self.driver_jdbc)
327
+ .option('numPartitions', custom_partition_count)
328
+ .option('partitionColumn', p_col_name)
329
+ .option('lowerBound', min_val)
330
+ .option('upperBound', max_val)
331
+ .option('fetchsize', fetchsize)
332
+ .load()
333
+ )
334
+ else:
335
+ # empty df, we need schema
336
+ df = (
337
+ spark.read.format('jdbc')
338
+ .option('url', self.jdbc_url)
339
+ .option('dbtable', updated_query)
340
+ .option('driver', self.driver_jdbc)
341
+ .option('fetchsize', fetchsize)
342
+ .load()
343
+ )
344
+
345
+ else:
346
+ df = (
347
+ spark.read.format('jdbc')
348
+ .option('url', self.jdbc_url)
349
+ .option('dbtable', updated_query)
350
+ .option('driver', self.driver_jdbc)
351
+ .option('fetchsize', fetchsize)
352
+ .load()
353
+ ).repartition(custom_partition_count)
354
+
355
+ df.write.parquet(parquet_path, mode=write_mode)
356
+
357
+ count_col = len(df.columns)
358
+ count_row = df.count()
359
+
360
+ data = {
361
+ 'table_name': target_name,
362
+ 'path': parquet_path,
363
+ 'file_type': 'parquet',
364
+ 'number_of_columns': count_col,
365
+ 'number_of_rows': count_row,
366
+ 'write_mode': write_mode,
367
+ 'partition_count': custom_partition_count,
368
+ 'fetchsize': fetchsize,
369
+ 'pass_on_error': self.pass_on_error,
370
+ 'replication_method': 'full',
371
+ }
372
+ message = dict(
373
+ table_name=target_name,
374
+ status='extracted',
375
+ meta_data=data,
376
+ )
377
+ logger.info(message)
378
+ return data
379
+ finally:
380
+ # Ensure Spark session is closed
381
+ spark.stop()
382
+
383
+ @log_container(__file__)
384
+ def extract(self):
385
+ extract_start_time = datetime.datetime.now()
386
+ logger = Logger(__file__)
387
+ logger.info({'message': 'Extracting data from SQLserver...'})
388
+ t = self.table
389
+ try:
390
+ target_name = t['target_name']
391
+ replication_method = t.get('replication_method', None)
392
+ if self.backend.get_table_status(target_name) in ['extracting', 'loading']:
393
+ logger.info(
394
+ {'message': f'Skipping {target_name}, already in progress...'}
395
+ )
396
+ data = {
397
+ 'table_name': target_name,
398
+ 'status': 'completed',
399
+ 'replication_method': 'full',
400
+ }
401
+ return data
402
+
403
+ self.backend.manifest_table_update(
404
+ name=target_name,
405
+ value=None, # Last point remains unchanged
406
+ value_type=None, # Type remains unchanged
407
+ status='extracting', # ('completed', 'failed', 'extracting', 'loading')
408
+ replication_method=replication_method, # ('incremental', 'full')
409
+ error_message='',
410
+ )
411
+ if replication_method == 'incremental':
412
+ return self.extract_incremental(t)
413
+ else:
414
+ return self.extract_full(t)
415
+
416
+ except Exception as e:
417
+ message = dict(
418
+ table_name=target_name,
419
+ status='failed',
420
+ type='pipeline',
421
+ error_message=str(e),
422
+ etl_start_time=str(extract_start_time),
423
+ )
424
+ self.backend.manifest_table_update(
425
+ target_name,
426
+ None,
427
+ None,
428
+ status='failed',
429
+ replication_method=replication_method,
430
+ error_message=str(e),
431
+ )
432
+ if self.pass_on_error:
433
+ logger.warning(message)
434
+ return None
435
+ else:
436
+ raise Exception(message) from e
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2023-2024 Metin Karakus
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,42 @@
1
+ Metadata-Version: 2.1
2
+ Name: mkpipe-extractor-sqlserver
3
+ Version: 0.1.0
4
+ Summary: SQLserver extractor for mkpipe.
5
+ Author: Metin Karakus
6
+ Author-email: metin_karakus@yahoo.com
7
+ License: Apache License 2.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: mkpipe
14
+
15
+ # MkPipe
16
+
17
+ **MkPipe** is a modular, open-source ETL (Extract, Transform, Load) tool that allows you to integrate various data sources and sinks easily. It is designed to be extensible with a plugin-based architecture that supports extractors, transformers, and loaders.
18
+
19
+ ## Documentation
20
+
21
+ For more detailed documentation, please visit the [GitHub repository](https://github.com/mkpipe-etl/mkpipe).
22
+
23
+ ## License
24
+
25
+ This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
26
+
27
+
28
+ ## mkpipe_project.yaml Variables
29
+ ```yaml
30
+ ...
31
+ connections:
32
+ source:
33
+ host: 'XXX'
34
+ port: 'XXX'
35
+ database: 'XXX'
36
+ user: 'XXX'
37
+ password: 'XXX'
38
+ ...
39
+ ```
40
+
41
+
42
+
@@ -0,0 +1,8 @@
1
+ mkpipe_extractor_sqlserver/__init__.py,sha256=7m47U5O7-2zna15iTygyWMMFNAjmSpvmMaS5xQ3UKew,17838
2
+ mkpipe_extractor_sqlserver/jars/com.microsoft.sqlserver_mssql-jdbc-12.8.1.jre11.jar,sha256=5pM8BxHlmKIkBg5S7TE5L3IKSnZk6F2K43xSqFtn67A,1476685
3
+ mkpipe_extractor_sqlserver-0.1.0.dist-info/LICENSE,sha256=6G5XWHq2ng2Te_IpVeOKvDabtRBPwqaImM7vpke0HOE,11348
4
+ mkpipe_extractor_sqlserver-0.1.0.dist-info/METADATA,sha256=nMoO_wTzZTwqJecWS8qciHuxh59onXBbswQhCoIfpBA,1114
5
+ mkpipe_extractor_sqlserver-0.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
6
+ mkpipe_extractor_sqlserver-0.1.0.dist-info/entry_points.txt,sha256=YWQKQYSCQl8IVRMiRhLNDIqgf13BuH-L0zKXKSbfpGg,78
7
+ mkpipe_extractor_sqlserver-0.1.0.dist-info/top_level.txt,sha256=z3qdgAYGXAl11etde_yqlXRFJ5xzNl_1Jl-3dVdi0jY,27
8
+ mkpipe_extractor_sqlserver-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.6.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [mkpipe.extractors]
2
+ sqlserver = mkpipe_extractor_sqlserver:SqlserverExtractor
@@ -0,0 +1 @@
1
+ mkpipe_extractor_sqlserver