-
Notifications
You must be signed in to change notification settings - Fork 58
Create manual_data_ingestion.md #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Alexandretubiana-marble
wants to merge
1
commit into
checkmarble:main
Choose a base branch
from
Alexandretubiana-marble:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+71
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,71 @@ | ||||||||
# Manually ingest your data using a storage bucket | ||||||||
|
||||||||
|
||||||||
This guide outlines the procedure for manually uploading data by directly | ||||||||
placing a CSV file into a storage bucket and creating a corresponding log entry | ||||||||
to trigger the ingestion process. | ||||||||
|
||||||||
## 1. Prepare and validate your CSV file | ||||||||
|
||||||||
Before initiating the manual upload, it is crucial to ensure your data is correctly | ||||||||
formatted. | ||||||||
|
||||||||
- **Create the CSV File:** Compile the data you need to ingest into a standard | ||||||||
CSV file. | ||||||||
- **Verify the format:** The structure of your CSV file (columns, headers, data | ||||||||
types) must exactly match the requirements of the target table in | ||||||||
checkmarble.com. | ||||||||
- **Recommendation:** To confirm the format, it is highly recommended to first | ||||||||
perform a standard upload using a small sample of your data (a few rows) | ||||||||
through the normal user interface. This will help you catch any formatting | ||||||||
errors before proceeding with the manual process, which may bypass some | ||||||||
validation checks. | ||||||||
|
||||||||
## 2. Upload the file to the storage bucket | ||||||||
|
||||||||
Once your CSV file is ready, you need to upload it to the designated cloud | ||||||||
storage bucket. | ||||||||
|
||||||||
- **Access the bucket:** Connect to your organization's cloud storage (e.g., | ||||||||
Amazon S3, Google Cloud Storage). | ||||||||
- **Define the file path:** The name and location of the file must follow a strict | ||||||||
naming convention. The path should be: `{org_id}/{table_name}/{unix_timestamp}.csv` | ||||||||
- `{org_id}`: Your organization's unique identifier. | ||||||||
- `{table_name}`: The name of the destination table for the data. | ||||||||
- `{unix_timestamp}`: The current time in Unix timestamp format (the number of | ||||||||
seconds since January 1, 1970). | ||||||||
- **Upload the file:** Place your CSV file in the specified path within the bucket. | ||||||||
|
||||||||
## 3. Create a record in `upload_logs` | ||||||||
|
||||||||
Next, you must manually insert a new record into the `upload_logs` database table. | ||||||||
This entry tells the system to process your uploaded file. | ||||||||
|
||||||||
- **Execute an SQL INSERT statement:** Run the following SQL command, | ||||||||
replacing the bracketed placeholders with the correct values: | ||||||||
```sql | ||||||||
INSERT INTO upload_logs (org_id, user_id, file_name, status, table_name) | ||||||||
VALUES ({org_id}, {user_id},'{file_name}','pending','{table_name}'); | ||||||||
``` | ||||||||
- **How to find the values:** | ||||||||
- `{org_id}`: Your organization's ID. | ||||||||
- `{user_id}`: The ID of the user performing the upload. You can find this by | ||||||||
running: `SELECT user_id, email FROM users;` | ||||||||
- `{file_name}`: The full path of the file you uploaded, exactly as it appears in | ||||||||
the storage bucket (e.g., `123/customers/1662631200.csv`). | ||||||||
- `{table_name}`: The name of the target table. | ||||||||
|
||||||||
## 4. Monitor the ingestion process | ||||||||
|
||||||||
Finally, you need to verify that the ingestion starts and completes successfully. | ||||||||
|
||||||||
- **Check for initiation:** Wait approximately one minute after creating the log | ||||||||
entry. Check the status of the upload in the `upload_logs` table or the | ||||||||
Checkmarble.com interface to ensure the process has started. The status | ||||||||
should change from `pending` to a state like `processing` or `running`. | ||||||||
- **Confirm completion:** Allow several minutes for the ingestion to finish. The | ||||||||
time required will depend on the size of your file. | ||||||||
Comment on lines
+66
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
- **Verify the outcome:** Once enough time has passed, check the log again to | ||||||||
confirm that the status has changed to `completed` or `success`. You should also | ||||||||
verify that the data appears correctly in the destination table within | ||||||||
checkmarble.com. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.