Skip to content

Wrong placeholder count error on INSERT ... FORMAT CSV #35

Description

@dizzyfool

Here's the case.

Prepare some db and test if it's working:

create table test (
     date DateTime,
     event String
) engine MergeTree() order by date;

insert into test format CSV
2021-01-01 00:00:00,click
2021-01-01 00:00:00,?

select * from test;

Run go code:

func TestIssue(t *testing.T) {
	conn, _ := dbr.Open("clickhouse", "http://user:pass@localhost:8123/db", nil)

	query := `insert into test (date, event) format CSV
2021-01-01 00:00:00,click
2021-01-01 00:00:00,?`

	_, err := conn.Exec(query)
	fmt.Println(err) //clickhouse: wrong placeholder count

	query = `insert into test (date, event) format CSV
"2021-01-01 00:00:00","click"
"2021-01-01 00:00:00","?"`

	_, err = conn.Exec(query)
	fmt.Println(err) //clickhouse: wrong placeholder count
}

I expect to get no errors here, because every query I run is perfectly valid.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions