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

writing directly to workers create issues with materialized tables #1665

Open
dev-mraj opened this issue May 9, 2024 · 3 comments
Open

writing directly to workers create issues with materialized tables #1665

dev-mraj opened this issue May 9, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@dev-mraj
Copy link

dev-mraj commented May 9, 2024

Hi,

We use this query to ingest large amount of data in batches to write workers directly (not servers) using http api (8123)

INSERT INTO db_abc.log Native SETTINGS prefer_cnch_catalog=1, max_threads_for_cnch_dump = 8

but get this errors that db_abc.log_attr_index table do not exists

CREATE MATERIALIZED VIEW IF NOT EXISTS 
				db_abc.log_attr_r_idx_mv 
				TO db_abc.log_attr_index 
			AS
			SELECT
				arrayJoin(mapKeys(resource_attributes)) AS key,
				resource_attributes[key] AS value,
				'resource' AS kind,
				toUnixTimestamp64Milli(now64()) AS ts
			FROM
			(
				SELECT resource_attributes
				FROM db_abc.log
				GROUP BY type,
					resource_attributes,
					timestampMs
			)
			GROUP BY key, value
@dev-mraj dev-mraj added the bug Something isn't working label May 9, 2024
@dev-mraj dev-mraj changed the title writing directly to workers create issues materilized tables writing directly to workers create issues with materialized tables May 9, 2024
@kevinthfang
Copy link
Contributor

Did you write to the workers using jdbc?

@dev-mraj
Copy link
Author

using using http api (port 8123) so client is not using jdbc its based on golang clickhouse driver and ch-go

its binary blocks works fine when sending to servers but not with workers, and reason behind sending to worker is scaling capability because servers can't scale horizontally (afaik) for any given single table

@jenrryyou
Copy link
Contributor

can you show the DDL for table db_abc.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants