Skip to content

Commit

Permalink
snowflake getTableSchemaForTable: error when table does not exist
Browse files Browse the repository at this point in the history
Was returning empty schema, which got as far as

COPY INTO "PUBLIC2"."SequelizeMeta"() FROM (...)

failing because an empty set of columns is a syntax error
  • Loading branch information
serprex committed Jan 17, 2024
1 parent c372ad6 commit cbbdd65
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flow/connectors/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ func (c *SnowflakeConnector) getTableSchemaForTable(tableName string) (*protos.T
columnTypes = append(columnTypes, string(genericColType))
}

if len(columnNames) == 0 {
return nil, fmt.Errorf("cannot load schema: table %s does not exist", tableName)
}

return &protos.TableSchema{
TableIdentifier: tableName,
ColumnNames: columnNames,
Expand Down

0 comments on commit cbbdd65

Please sign in to comment.