Skip to main content

Data Access Grants

Configure the necessary permissions to allow ZettaQuant to access your Snowflake data.

Prerequisites for Custom Datasets

If you're configuring a custom dataset, ensure you have the following table structures:

1. Document Table

Your document table must have at least:

  • document_id column (table name can be anything)

2. Sentence Table

Your sentence table must have at least these 3 columns:

  • document_id (links to document table)
  • sentence_id (unique identifier for each sentence)
  • sentence_text (the actual sentence content)
  • (table name can be anything)

Note: If you're using the PDF ingestion feature of the app, these tables will be created for you automatically if they don't exist already.

Grant Permissions

Basic Database and Schema Access

To allow the app to use your tables, run these queries first:

GRANT USAGE ON DATABASE {YOUR_DATABASE_IN_WHICH_YOUR_TABLES_ARE_STORED} TO APPLICATION {YOUR_APP_NAME};
GRANT USAGE ON SCHEMA {YOUR_DATABASE.YOUR_SCHEMA} TO APPLICATION {YOUR_APP_NAME};

Table Creation (Required for PDF Ingestion)

If you plan to create tables via the app, run:

GRANT CREATE TABLE ON SCHEMA {YOUR_DATABASE.YOUR_SCHEMA} TO APPLICATION {YOUR_APP_NAME};

Existing Tables Access

If your sentences and documents tables already exist, grant access:

GRANT SELECT ON {YOUR_DATABASE.YOUR_SCHEMA.YOUR_SENTENCES_TABLE} TO APPLICATION {YOUR_APP_NAME};
GRANT SELECT ON {YOUR_DATABASE.YOUR_SCHEMA.YOUR_DOCS_TABLE} TO APPLICATION {YOUR_APP_NAME};

Viewing App-Created Tables

To view tables created by the app, ensure you have the proper role privileges:

GRANT SELECT, INSERT, UPDATE ON TABLE {table_name} TO ROLE {your_role};

PDF Ingestion Requirements

For PDF ingestion functionality, ensure:

  1. Database Usage: Run the basic database grant mentioned above
  2. Schema Usage: Run the basic schema grant mentioned above
  3. Table Creation: Grant CREATE TABLE privileges:
GRANT CREATE TABLE ON SCHEMA {YOUR_DATABASE.YOUR_SCHEMA} TO APPLICATION {YOUR_APP_NAME};

Troubleshooting Access Issues

If you can't see or access tables created by the app, you may need additional privileges:

GRANT SELECT, INSERT, UPDATE ON TABLE {table_name} TO ROLE {your_role};

Replace {table_name} and {your_role} with your specific table names and role.