-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from keboola/CM-792-ondra
Fix Incremental Fetching
- Loading branch information
Showing
11 changed files
with
72 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/functional/incremental-fetching-large-limit-state/expected-code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
3 changes: 3 additions & 0 deletions
3
tests/functional/incremental-fetching-large-limit-state/expected-stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Connected to mongodb://mongodb:27017/test | ||
Exporting "incremental" | ||
Done "incremental", parsed 4 records in total |
Empty file.
1 change: 1 addition & 0 deletions
1
tests/functional/incremental-fetching-large-limit-state/expected/data/out/state.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lastFetchedRow": 4} |
Empty file.
5 changes: 5 additions & 0 deletions
5
...unctional/incremental-fetching-large-limit-state/expected/data/out/tables/incremental.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"id","decimal","date","timestamp" | ||
"1","123.344","2020-05-18T16:00:00Z","1587646020" | ||
"2","133.444","2020-02-15T13:00:00Z","1587626020" | ||
"3","783.028","2020-05-18T11:00:00Z","1587606020" | ||
"4","283.473","2020-04-18T16:00:00Z","1587146020" |
1 change: 1 addition & 0 deletions
1
.../incremental-fetching-large-limit-state/expected/data/out/tables/incremental.csv.manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"primary_key":null,"incremental":true} |
12 changes: 12 additions & 0 deletions
12
tests/functional/incremental-fetching-large-limit-state/setUp.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
use MongoExtractor\FunctionalTests\DatadirTest; | ||
use MongoExtractor\Tests\Traits\ImportDatasetTrait; | ||
|
||
return static function (DatadirTest $test): void { | ||
(new class { | ||
use ImportDatasetTrait; | ||
})::importDatatasetNoAuthDb('incremental', 'dataset-incremental-fetching.json'); | ||
}; |
20 changes: 20 additions & 0 deletions
20
tests/functional/incremental-fetching-large-limit-state/source/data/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"parameters": { | ||
"db": { | ||
"host": "mongodb", | ||
"port": 27017, | ||
"database": "test" | ||
}, | ||
"tableName": "incremental", | ||
"collection": "incremental", | ||
"incremental": true, | ||
"incrementalFetchingColumn": "id", | ||
"limit": "1000", | ||
"mapping": { | ||
"id": "id", | ||
"decimal": "decimal", | ||
"date.$date": "date", | ||
"timestamp": "timestamp" | ||
} | ||
} | ||
} |