Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DuckDBDialect.insert_into_temp_tables is missing quote='\"' #62

Description

@MicioGatto

Child tables that are elevated to the parent as a concatenated string are correctly quoted in the generated CSV as part of DuckDBDialect.insert_into_temp_tables. However, when the file is then read for insert, the quote char is auto detected. If no rows are quoted in the sample used for the auto detect, then the correct quote char is not detected. This in turn causes the insert to fail as the incorrect number of columns are detected.

This can be resolved by specifying the quote char in the SQL statement:

sql = text( f"INSERT INTO {full_name} ({insert_cols}) " f"SELECT {select_exprs} " f"FROM read_csv('{safe_path}', header=true, nullstr='', all_varchar=true, quote='\"')" )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions