Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dizzyfool opened this issue Mar 30, 2021 · 0 comments
Open

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

dizzyfool opened this issue Mar 30, 2021 · 0 comments

Comments

@dizzyfool
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant