Source Scheduling
The scheduling specifies "when" or "how frequently" your pipeline triggers source crawls to
look for new data to ingest.
For example, if you configure a pipeline to ingest data from an S3 source into an index
unit, and specify a Source scheduling every day at 3:00 PM, the
pipeline triggers a crawl each day at that time by:
- Contacting the S3 provider and listing the files available at that instant.
- Processing the files if applicable.
- Returning to
idle mode until the next scheduling trigger.
If anything happens on the S3 at any other moment, the pipeline does not react. In our
example:
- If a new file is added at 3:45 PM, the pipeline waits until the next day at 3:00 PM to
process it.
- If you decide to remove that file before the pipeline triggers, from the pipeline point
of view the file does not exist.
Update Strategies for the Target Storage
This aspect defines how the pipeline interacts with its output target storage. When
updating or deleting a file that was already ingested in the past, there are two possible
update strategies depending on your pipeline type:
| Strategy |
Description |
| Clear & push |
Rolls back all the content ingested by the previous version of the file and
pushes the new content of the latest version. |
| Push only |
Pushes the new content without looking at existing content in the target
storage. This may override previous content, for example, if you push an item into
an index-unit that already contains another item with the same uri. This usually
concerns data that was removed from the input file content since the last pipeline
trigger. Note:
The term Push only does not necessarily mean
adding items. For pipelines that support it, you can also push delete order. This
is the case for the
Index Event Data and the
Data Consolidation pipelines.
|
Supported Crawls and Update Strategies by Pipeline Types
| Pipeline type |
Supported crawls |
Update strategies |
| Incremental |
Recrawl |
Clear & push |
Push only |
|
Index Tabular Data
(S3/DOS) (CSV/Parquet/Json) |
|
|
|
|
|
Index Event Data
(S3/DOS) |
|
|
|
|
|
Copy Object Data |
|
|
|
|
|
Pipeline Pilot Protocol |
|
|
|
|
|
Data Consolidation |
|
|
|
|
|
Export index Data |
|
|
|
|
|
Text Extraction |
|
|
|
|
|
Feed Text Intelligence Studio |
|
|
|
|
|
Export Text Intelligence Studio Annotations |
|
|
|
|
Example: Index Tabular with CSV from S3
In this example, we index CSV data from an S3 using an
Index Tabular Data pipeline.
-
Push the following files:
first-sample.csv contains:
uri, foo, bar
item-A, a, 1
item-B, b, 2
item-C, c, 3
second-sample.csv contains:
uri, foo, bar
item-D, ddd, 444
item-E, eee, 555
item-C, ccc, 333
third-sample.csv contains:
uri, foo, bar
item-E, EE,
item-F, FF,
The next pipeline run ingests the 3 files. However, we can see that:
- The
item-C uri is present in both first-sample.csv
and second-sample.csv files. The second-sample.csv
file overrides the value pushed by the first-sample.csv file.
- Similarly, the
second-sample.csv file pushes
item-E but third-sample.csv overrides it
immediately.
After the pipeline execution, the index unit looks like this:
| uri |
foo |
bar |
| item-A |
a |
1 |
| item-B |
b |
2 |
| item-C |
ccc |
333 |
| item-D |
ddd |
444 |
| item-E |
EE |
null |
| item-F |
FF |
null |
- We update the
first-sample.csv file and wait for the pipeline to run a
second time. first-sample.csv (Version 2)
contains:
uri, foo, bar
item-G, g, 7 As the
Index Tabular Data pipeline supports incremental crawl, Data Factory Studio does not reingest the second-sample.csv and the
third-sample.csv files because they have not changed. However, as the
first-sample.csv file contains updates, Data Factory Studio fetches it again. In our example, the update strategy is Clear
& Push, so Data Factory Studio:
- First removes all the items added by the first version of the file, that is
item-A and item-B.
- Does not have to remove the
item-C version that is already in the
index, as it is the version pushed by the second-sample.csv
file.
The index unit gets the following content:
| uri |
foo |
bar |
| item-C |
ccc |
333 |
| item-D |
ddd |
444 |
| item-E |
EE |
null |
| item-F |
FF |
null |
| item-G |
g |
7 |
- We now delete the
third-sample.csv file from the input S3 storage.In
the next pipeline run, Data Factory Studio removes all items coming from the third-sample.csv file. It removes
item-E and item-F. The index unit now has the
following content:
| uri |
foo |
bar |
| item-C |
ccc |
333 |
| item-D |
ddd |
444 |
| item-G |
g |
7 |
Note:
Data Factory Studio first pushed item-E from the second-sample.csv
file, and then overrode it with the third-sample.csv file. When we
deleted the third-sample.csv file, Data Factory Studio did not recover the value from the second-sample.csv file. The index
does not contain item-E after the delete because it does not keep old
values of overridden items. For this reason, avoid having multiple files containing the
same URIs and do not rely on overriding, even if it is supported to facilitate trivial
use-cases.
Example: Index JSON Events from S3
In this example, we index JSON events using an
Index Event Data pipeline.
This pipeline supports incremental crawl like the
Index Tabular Data pipeline, but it only supports Push
only updates to the target storage.
This example shows the scenario used in Example: Index Tabular with CSV from S3, but with
JSON events instead of CSV files.
-
Push the following files:
first-sample.json contains:
[
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-A",
"foo": "a",
"bar": "1"
}
},
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-B",
"foo": "b",
"bar": "2"
}
},
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-C",
"foo": "c",
"bar": "3"
}
}
]
second-sample.json contains:
[
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-D",
"foo": "ddd",
"bar": "444"
}
},
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-e",
"foo": "eee",
"bar": "555"
}
},
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-C",
"foo": "ccc",
"bar": "333"
}
}
]
third-sample.json contains:
[
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-E",
"foo": "EE"
}
},
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-F",
"foo": "FF"
}
}
]
These JSON event data produce the same results as in the first CSV example. As in the
CSV case, Data Factory Studio overrides item-C and item-E.
After the pipeline execution, the index unit looks like this:
| uri |
foo |
bar |
| item-A |
a |
1 |
| item-B |
b |
2 |
| item-C |
ccc |
333 |
| item-D |
ddd |
444 |
| item-E |
EE |
null |
| item-F |
FF |
null |
- We update the
first-sample.json file and wait for the pipeline to run a
second time. first-sample.json (Version 2) contains:
[
{
"action": "AddOrReplaceItem",
"item": {
"class": "com.MyClass",
"uri": "item-G",
"foo": "g",
"bar": "7"
}
}
]In this example, the update strategy is Push only,
so Data Factory Studio does not remove the old values of the first-sample.json file from
the index. The index unit gets the following content:
| uri |
foo |
bar |
| item-A |
a |
1 |
| item-B |
b |
2 |
| item-C |
ccc |
333 |
| item-D |
ddd |
444 |
| item-E |
EE |
null |
| item-F |
FF |
null |
| item-G |
g |
7 |
- We now delete the
third-sample.json file from the input S3 storage and
see that nothing happens in our index unit. If we reindexed the pipeline from scratch,
the result would be different because the files that remain in our S3 storage are
first-sample.json (Version 2) and
second-sample.json. The index unit would have the following
content:
| uri |
foo |
bar |
| item-C |
ccc |
333 |
| item-D |
ddd |
444 |
| item-E |
eee |
555 |
| item-G |
g |
7 |
Here we get a reproducibility issue, and see why it is not recommended to
override files in pipelines with Push only update
strategies.
|