Skip to main content

SnowflakeTableRetriever

Connects to a Snowflake database to execute a SQL query using ADBC and Polars.

Basic Information

  • Type: haystack_integrations.snowflake.src.haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.SnowflakeTableRetriever

Inputs

ParameterTypeDefaultDescription
querystrThe SQL query to execute.
return_markdownOptional[bool]NoneWhether to return a Markdown-formatted string of the DataFrame. If not provided, uses the value set during initialization.

Outputs

ParameterTypeDefaultDescription
dataframeDataFrameA dictionary containing: - "dataframe": A Pandas DataFrame with the query results. - "table": A Markdown-formatted string representation of the DataFrame.
tablestrA dictionary containing: - "dataframe": A Pandas DataFrame with the query results. - "table": A Markdown-formatted string representation of the DataFrame.

Overview

Work in Progress

Bear with us while we're working on adding pipeline examples and most common components connections.

Connects to a Snowflake database to execute a SQL query using ADBC and Polars. Returns the results as a Pandas DataFrame (converted from a Polars DataFrame) along with a Markdown-formatted string. For more information, see Polars documentation. and ADBC documentation.

Usage Example

components:
SnowflakeTableRetriever:
type: snowflake.src.haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.SnowflakeTableRetriever
init_parameters:

Parameters

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
userstrUser's login.
accountstrSnowflake account identifier.
api_keySecretSecret.from_env_var('SNOWFLAKE_API_KEY')Snowflake account password.
databaseOptional[str]NoneName of the database to use.
db_schemaOptional[str]NoneName of the schema to use.
warehouseOptional[str]NoneName of the warehouse to use.
login_timeoutOptional[int]60Timeout in seconds for login.
return_markdownboolTrueWhether to return a Markdown-formatted string of the DataFrame.

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
querystrThe SQL query to execute.
return_markdownOptional[bool]NoneWhether to return a Markdown-formatted string of the DataFrame. If not provided, uses the value set during initialization.