BlobDataCSV
BlobDataCSV Objects
class BlobDataCSV(CSVParser.CSVParser)
ApertureDB Blob Data.
This class loads the Blob Data which is present in a CSV file, and converts it into a series of ApertureDB queries.
Is backed by a CSV file with the following columns:
FILENAME
, PROP_NAME_1
, ... PROP_NAME_N
, constraint_PROP_NAME_1
FILENAME: The path of the blob object on the file system.
PROP_NAME_1 ... PROP_NAME_N: Arbitrary property names associated with this blob.
constraint_PROP_NAME_1: Constraints against specific property, used for conditionally adding a Blob.
Example CSV file::
filename,name,lastname,age,id,constraint_id
/mnt/blob1,John,Salchi,69,321423532,321423532
/mnt/blob2,Johna,Salchi,63,42342522,42342522
...
Example usage:
data = BlobDataCSV("/path/to/BlobData.csv")
loader = ParallelLoader(client)
loader.ingest(data)
info
In the above example, the constraint_id ensures that a blob with the specified id would be only inserted if it does not already exist in the database.