This message was deleted.
# replication-ask-ai
s
This message was deleted.
k
Thinking completed I'm sorry, but there is no information in the provided knowledge sources regarding the SQL compilation error:
invalid type [CAST(CONNECTORINSTANCES.XSLT_CONFIGS AS OBJECT)] for parameter 'TO_OBJECT'
The available documents discuss unrelated issues with the MongoDB source (such as saved offset and resume token errors) and Snowflake destination (such as reserved keywords, timestamp parsing, or numeric casting), but they do not contain details about this specific
TO_OBJECT
casting error or queries on
CONNECTORINSTANCES.XSLT_CONFIGS
. This error appears to originate from a custom transformation, dbt model, view definition, or internal Snowflake query running
TO_OBJECT()
on a field (
XSLT_CONFIGS
) that is already typed as an
OBJECT
or contains an incompatible data structure. You may need to review your custom transformations, normalization queries, or downstream views executed in Snowflake on the synced MongoDB data. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
r
@kapa.ai postgres
k
Thinking completed In Airbyte, PostgreSQL can be used as either a source or a destination connector. Airbyte Postgres Destination Overview The Postgres destination connector allows you to sync data from various sources directly into a PostgreSQL database [Postgres]. • Direct Load Architecture: Starting with version
3.0.0
, the connector uses a Direct Load architecture, writing records directly to final tables rather than creating intermediate raw tables [Postgres; metadata.yaml]. • Usage Guidance: Postgres is best suited as a destination for smaller data volumes (e.g., less than 10GB) or testing purposes; for large volumes, a cloud data warehouse (such as Snowflake, BigQuery, or Redshift) is recommended [Postgres]. Prerequisites & Setup • Postgres Version: Requires PostgreSQL server version
9.5
or higher [Postgres]. • Connection Security: Airbyte Cloud requires SSL/TLS encryption (TLS is enabled by default) [Postgres]. • Required Permissions: A user with privileges to create tables, write rows, and create schemas:CREATE USER airbyte_user WITH PASSWORD 'password'; GRANT CREATE, TEMPORARY ON DATABASE database TO airbyte_user;[Postgres] Output Schema & Metadata Columns Each stream writes to a final table that includes the extracted source columns along with Airbyte metadata fields: •
_airbyte_raw_id
(
VARCHAR
): Unique UUID assigned to each processed event [Schema map]. •
_airbyte_extracted_at
(
TIMESTAMP WITH TIME ZONE
): Timestamp of when the record was pulled from the source [Schema map]. •
_airbyte_meta
(
JSONB
): Sync metadata and schema change information [Schema map]. •
_airbyte_generation_id
(
BIGINT
): Identifier for the sync generation [Schema map]. If you have a specific question about configuring Postgres as a source or destination, troubleshooting an error, or managing schema mappings, please provide more details! šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
r
@kapa.ai the problem happened at PostgreSQL with target SNowflake
k
Thinking completed I'm sorry, but the provided knowledge sources do not contain information about the specific SQL compilation error:
invalid type [CAST(CONNECTORINSTANCES.XSLT_CONFIGS AS OBJECT)] for parameter 'TO_OBJECT'
occurring in a PostgreSQL-to-Snowflake connection. While the sources mention other issues when syncing to Snowflake (such as reserved column names causing SQL compilation errors or timestamp parsing failures) [Github Issue (closed): destination-snowflake cannot sync a source table with ROW_NUMBER column to Snowflake; Github Issue (open): Unable to setup Snowflake Connector (as Destination) when Legacy raw tables option enabled], they do not reference
TO_OBJECT
,
XSLT_CONFIGS
, or type conversion issues for that parameter. This error usually indicates that Snowflake's
TO_OBJECT()
function is being executed (likely in a downstream transformation, dbt model, view, or typing/deduping step) on a field that cannot be converted to an object in that format. Check downstream transformations or schema typing configurations applied to the
XSLT_CONFIGS
column in Snowflake. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
r
@kapa.ai sorry error from MOngo to SNowflake
k
Thinking completed I am sorry, but the provided knowledge sources do not contain information about the error:
invalid type [CAST(CONNECTORINSTANCES.XSLT_CONFIGS AS OBJECT)] for parameter 'TO_OBJECT'
for a MongoDB to Snowflake connection either. The knowledge sources discuss other MongoDB source errors (such as
Field 'allowDiskUse' is currently not supported
) [Github Issue (open): [source-mongodb] Field 'allowDiskUse' is currently not supported] and various Snowflake destination issues (such as
ROW_NUMBER
column conflicts or unrecognized data values) [Github Issue (closed): destination-snowflake cannot sync a source table with ROW_NUMBER column to Snowflake; Github Issue (closed): [destination-snowflake] Entire connection sync fails if one value is not recognized], but there is no mention of
TO_OBJECT
parameter errors or queries on
CONNECTORINSTANCES.XSLT_CONFIGS
. This SQL compilation error is generated by Snowflake when
TO_OBJECT()
receives an invalid argument type. In a MongoDB-to-Snowflake sync, this typically happens when: 1. A custom downstream dbt model, view, or transformation attempts to cast
XSLT_CONFIGS
to an object using
TO_OBJECT(CAST(... AS OBJECT))
, which is invalid syntax in Snowflake. 2. Typing and deduping attempts to interpret a MongoDB field (
XSLT_CONFIGS
) whose discovered JSON schema type conflicts with the expected Snowflake variant/object structure. To resolve it, inspect the connection's sync logs to identify whether the failing query originates from an Airbyte normalization/typing-and-deduping step or from a downstream dbt/custom SQL transformation, and check how
XSLT_CONFIGS
is being cast or structured in Snowflake. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
r
@kapa.ai 2026-09-27 030222 destination ERROR main i.a.c.AirbyteConnectorRunnable(run):38 Failed class io.airbyte.cdk.load.write.WriteOperation operation execution. net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: invalid type [CAST(CONNECTORINSTANCES.XSLT_CONFIGS AS OBJECT)] for parameter 'TO_OBJECT' at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:180) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:112) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:511) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:416) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:502) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:211) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:145) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.core.SFStatement.execute(SFStatement.java:779) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.core.SFStatement.execute(SFStatement.java:697) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:293) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQuery(SnowflakeStatementV1.java:149) ~[snowflake-jdbc-thin-3.26.1.jar:3.26.1] at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:111) ~[HikariCP-7.0.2.jar:?] at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java) ~[HikariCP-7.0.2.jar:?] at io.airbyte.integrations.destination.snowflake.client.SnowflakeAirbyteClientKt.execute(SnowflakeAirbyteClient.kt:426) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?] at io.airbyte.integrations.destination.snowflake.client.SnowflakeAirbyteClient.execute$io_airbyte_airbyte_integrations_connectors_destination_snowflake(SnowflakeAirbyteClient.kt:399) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?] at io.airbyte.integrations.destination.snowflake.client.SnowflakeAirbyteClient.applyChangeset-072v0zg(SnowflakeAirbyteClient.kt:284) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?] at io.airbyte.cdk.load.component.TableSchemaEvolutionClient.ensureSchemaMatches-Uhgc1Ac$suspendImpl(TableSchemaEvolutionClient.kt:67) ~[bulk-cdk-core-load-1.0.25.jar:?] at io.airbyte.cdk.load.component.TableSchemaEvolutionClient.ensureSchemaMatches-Uhgc1Ac(TableSchemaEvolutionClient.kt) ~[bulk-cdk-core-load-1.0.25.jar:?] at io.airbyte.integrations.destination.snowflake.client.SnowflakeAirbyteClient.ensureSchemaMatches-Uhgc1Ac(SnowflakeAirbyteClient.kt:217) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?] at io.airbyte.cdk.load.table.directload.DirectLoadTableDedupStreamLoader.teardown(DirectLoadTableStreamLoader.kt:124) ~[bulk-cdk-core-load-1.0.25.jar:?] at io.airbyte.cdk.load.dataflow.DestinationLifecycle$finalizeIndividualStreams$2$1$1.invokeSuspend(DestinationLifecycle.kt:96) ~[bulk-cdk-core-load-1.0.25.jar:?] at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-2.1.10.jar:2.1.10-release-473] at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) ~[kotlinx-coroutines-core-jvm-1.8.1.jar:?] at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) ~[kotlinx-coroutines-core-jvm-1.8.1.jar:?] at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811) ~[kotlinx-coroutines-core-jvm-1.8.1.jar:?] at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715) ~[kotlinx-coroutines-core-jvm-1.8.1.jar:?] at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702) ~[kotlinx-coroutines-core-jvm-1.8.1.jar:?]
k
Thinking completed The knowledge sources do not explicitly mention this exact
invalid type [CAST(... AS OBJECT)] for parameter 'TO_OBJECT'
compilation error, but the stack trace provides key details about where and why it occurs: Cause of the Failure 1. Failure Point (
TableSchemaEvolutionClient.ensureSchemaMatches
/
applyChangeset
)
According to the stack trace, the failure happens during schema evolution when applying table alterations:io.airbyte.integrations.destination.snowflake.client.SnowflakeAirbyteClient.applyChangeset io.airbyte.cdk.load.component.TableSchemaEvolutionClient.ensureSchemaMatchesWhen the connector detects a schema change between the source stream and the destination table, it generates SQL statements to evolve the schema and adapt existing columns [SnowflakeDirectLoadSqlGenerator.kt; TableSchemaEvolutionClient.kt]. 2. Column Type Evolution to
OBJECT
The column
XSLT_CONFIGS
in the
CONNECTORINSTANCES
table had its type modified in the incoming stream (for instance, changing from a string/scalar to a structured object/JSON type). To convert existing data to the new type during an
ALTER TABLE
, the connector generates an
UPDATE
statement with a conversion expression [Github Issue (open): destination-snowflake: follow-ups from safe type-aware retype casts; SnowflakeDirectLoadSqlGenerator.kt]. 3. Snowflake SQL Compilation Failure The generated SQL contains a call to
TO_OBJECT(...)
wrapping a
CAST(... AS OBJECT)
expression. Snowflake rejects this syntax at compile time because
TO_OBJECT
does not accept an expression that is already cast to or treated as
OBJECT
. Potential Workarounds Because this failure occurs during direct-load schema alteration in the connector: 1. Reset or Truncate the Stream in Airbyte If historical data in the destination does not need to be migrated in-place, resetting/refreshing the
CONNECTORINSTANCES
stream will drop or recreate the target table with the new schema, bypassing the failing
ALTER TABLE
/
UPDATE
retype statement [BigqueryDirectLoadNativeTableOperations.kt]. 2. Manually Update the Column in Snowflake Manually align the
XSLT_CONFIGS
column's data type in Snowflake to match what the source stream expects (e.g., manually casting/converting the column or renaming/dropping it) so that
computeChangeset
determines the column is already up-to-date and avoids generating the invalid
UPDATE
expression [BigqueryDirectLoadNativeTableOperations.kt; TableSchemaEvolutionClient.kt]. 3. Check for Connector Updates Check for newer versions of
destination-snowflake
. Recent releases have actively addressed retyping casts during schema evolution (such as per-type conversion expressions for scalar-to-object retypes) [Github Issue (open): destination-snowflake: follow-ups from safe type-aware retype casts]. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.