Skip to content

SNOW-2327397: Schema is not inferred during write operations #3757

@andrea-santoro1-a2a

Description

@andrea-santoro1-a2a
  1. What version of Python are you using?

    3.12

  2. What operating system and processor architecture are you using?

    Docker image python:3.12-slim

  3. What are the component versions in the environment (pip freeze)?

    snowflake-snowpark-python==1.38.0

  4. What did you do?

    When performing write operations, such as uploading a dataframe to a table or performing a merge over an existing table, schema is not inferred from the given table name even if the table name has a (semi-)fully qualified name (for example schema.table or db.schema.table).

    The resulting error, however states that using the (semi-)fully qualified name is indeed an option. For example, this is the error message shown when performing a merge with fully qualified table names:

    ClientError: AlgorithmError: SnowparkSQLException("090106 (22000): 01beeed7-0305-2a87-0001-8d0a1f96a5d6: Cannot perform DROP. This session does not have a current schema. Call 'USE SCHEMA', or use a qualified name.", '1304', '01beeed7-0305-2a87-0001-8d0a1f96a5d6'), exit code: 1

    By explicitly setting the schema with sql (session.sql("USE SCHEMA ...").collect()), the same merge operation succeeds.

  5. What did you expect to see?

    Infer and automatically set the right schema when table name is formatted as schema.table or db.schema.table, as the above error suggests

  6. Can you set logging to DEBUG and collect the logs?

    I'll add this if needed, doesn't seem useful to me

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds triageInitial RCA is required

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions