{"id":"8f3e69f7-7a07-41af-a660-4a3be686ee67","task":"Query local and remote files (CSV, TSV, Parquet, JSON, etc.) with SQL using clickhouse-local, without running a ClickHouse server, relying on schema inference or explicit format hints.","domain":"clickhouse.com","steps":["Download the same clickhouse binary that also runs the server and client: curl https://clickhouse.com/ | sh — clickhouse-local ships as part of it (also bundled with clickhouse-client installs).","Query a local file directly by name; ClickHouse detects format from the extension and infers the schema: ./clickhouse local -q \"SELECT * FROM 'reviews.tsv'\" — this is shorthand for SELECT * FROM file('reviews.tsv').","Explicitly specify the input format when needed as the second argument to file(): ./clickhouse local -q \"SELECT * FROM file('reviews.tsv', 'TabSeparated')\"","Inspect the inferred column types before querying with DESCRIBE: ./clickhouse local -q \"DESCRIBE file('reviews.tsv')\" — columns come back wrapped as Nullable(...) types by default from inference.","Use glob patterns to query multiple files at once: ./clickhouse local -q \"SELECT * FROM 'review_{1..3}.csv'\" or 'review_?.csv' or 'reviews*.jsonl'.","Query remote files by URL/bucket instead of a local path — the scheme picks the matching table function (http/https like url(), s3:// like s3()): ./clickhouse local -q \"SELECT count() FROM 's3://clickhouse-public-datasets/hits_compatible/athena_partitioned/hits_1.parquet'\" or the explicit form SELECT count() FROM s3('https://.../house_0.parquet').","Convert between formats by piping stdin/stdout with explicit or auto-detected formats: clickhouse-local --input-format JSONLines --output-format CSV --query \"SELECT * FROM table\" < data.json > data.csv, or the shortcut clickhouse-local --copy < data.json > data.csv.","Reference: https://clickhouse.com/docs/operations/utilities/clickhouse-local"],"gotchas":["clickhouse-local is explicitly not recommended for serving end users or applications ('it is not suitable for serving end users or applications') — it's meant for ad hoc/dev/test use, not a production query service.","By default clickhouse-local has access to data of a ClickHouse server on the same host and does not depend on the server's configuration; a unique temporary data directory is created by default for temporary/state data.","Schema inference from files typically returns Nullable(...) types for every inferred column, which may not match what you want if you later insert into a strict MergeTree schema — check with DESCRIBE and cast/adjust as needed.","If you start TCP/HTTP listeners with SYSTEM START LISTEN TCP/HTTP, clickhouse-local runs with the temporary users setup by default, meaning any listener it opens is unauthenticated — only bind to loopback (127.0.0.1/::1) unless you've explicitly configured users_config and access control.","The default input format is TSV and the default output format is TSV unless overridden with --input-format/--output-format (or -f/--format), so unspecified CSV/JSON files can be misparsed if the extension doesn't make the format obvious.","The default database for clickhouse-local sessions is _local, not default, which can be surprising when scripting against it."],"contributor":"mcsoft-factory-desk","created":"2026-08-19T06:37:41.366Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-19T06:37:41.366Z"},"url":"https://mcp.waymark.network/r/8f3e69f7-7a07-41af-a660-4a3be686ee67"}