Using Flex Tables for IDOL Data
You can create flex tables to use with the IDOL Connector Framework Server (CFS) and an ODBC client. The CFS VerticaIndexer module uses the connector to retrieve data. CFS then indexes the data into your Vertica database.
CFS supports many connectors for interfacing to different unstructured file types stored in repositories. Examples of repositories include Microsoft Exchange (email), file systems (including Word documents, images, and videos), Microsoft SharePoint, and Twitter (containing Tweets).
Connectors retrieve and aggregate data from repositories. CFS indexes the data, sending it to IDOL, IDOL OnDemand, or Vertica. The following figure illustrates a basic setup with a repository and a connector.
After you configure CFS and connect it to your Vertica database, the connector monitors the repository for changes and deletions to loaded documents, and for new files not previously added to the server. CFS then updates its server destinations automatically.
To achieve the best query results with ongoing CFS updates and deletes, Vertica recommends using live aggregate projections and top-K projections. For more information about how these projections work, and for examples of using them, see Working with Projections in the Administrator's Guide.
ODBC Connection String for CFS
There are several steps to setting up the CFS VerticaIndexer to load IDOL metadata into your database.
One of the first steps is to add information to the CFS configuration file. To do so, add an
Indexing section to the configuration file that specifies the ODBC ConnectionString details.
Successfully loading data requires a valid database user with write permissions to the destination table. Two ODBC connection parameters (
PWD) specify the Vertica user and password. The following example shows a sample CFS
Indexing section. The section includes a
ConnectionString with the basic parameters, including a sample user (
UID=fjones) and password (
[Indexing] IndexerSections=vertica IndexTimeInterval=30
[vertica] IndexerType = Library ConnectionString=Driver=Vertica;Server=123.456.478.900;Database=myDB;UID=fjones;PWD=fjones_password TableName = marcomm.myFlexTable LibraryDirectory = ./shared_library_indexers LibraryName = verticaIndexer
For more information about ODBC connection parameters, see ODBC Configuration Parameters.
CFS COPY LOCAL Statement
CFS first indexes and processes metadata from a document repository to add to your database. Then, CFS uses the Indexing information you added to the configuration file to create an ODBC connection. After establishing a connection, CFS generates a standard
COPY LOCAL statement, specifying the
fjsonparser. CFS loads data directly into your pre-existing flex table with a statement such as the following:
=> COPY myFlexTable FROM LOCAL path_to_compressed_temporary_json_file PARSER fjsonparser();
=> SELECT * FROM myavro; __identity__ | __raw__ --------------+--------- (0 rows)
When your IDOL metadata appears in a flex table, you can optionally add new table columns, or materialize other data, as described in Altering Flex Tables.