Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions contribute/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ClickHouse Community Code of Conduct
# ClickHouse community code of conduct
This code of conduct governs ClickHouse Community discussions, channels, and events.

## Introduction {#introduction}
Expand All @@ -7,13 +7,13 @@ This code of conduct governs ClickHouse Community discussions, channels, and eve
* Our goal is to maintain a safe and friendly community for everyone, regardless of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other defining characteristic.
* This code and related procedures apply to unacceptable behavior occurring in all community venues, including behavior outside the scope of community activities — online and in-person — as well as in all one-on-one communications, and anywhere such behavior has the potential to adversely affect the safety and well-being of community members.

## Expected Behavior {#expected-behavior}
## Expected behavior {#expected-behavior}
* Be welcoming.
* Be kind and patient.
* Look out for each other.
* Be careful and aware of your wording and tone.

## Unacceptable Behavior {#unacceptable-behavior}
## Unacceptable behavior {#unacceptable-behavior}
* Conduct or speech which might be considered sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory or offensive in nature.
* Do not use unwelcome, suggestive, derogatory or inappropriate nicknames or terms.
* Do not show disrespect towards others. (Jokes, innuendo, dismissive attitudes.)
Expand Down
8 changes: 4 additions & 4 deletions contribute/contrib-writing-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Our build process is a little different because part of our docs are in the [Cli
The documentation is built with Docusaurus, which requires Node.js. We recommend version 18. Install [Node.js](https://nodejs.org/en/download/).


### Installing npm and yarn {#installing-npm-and-yarn}
### Installing NPM and yarn {#installing-npm-and-yarn}

We use [yarn classic](https://classic.yarnpkg.com/lang/en/) to build the ClickHouse docs.

Expand Down Expand Up @@ -146,12 +146,12 @@ We have seen more and more 404s as the size of the docs grow.
It seems that these are related to the use of `../` in the path to the markdown files. Please write links to other doc
pages as:

#### link to another doc {#link-to-another-doc}
#### Link to another doc {#link-to-another-doc}
```md title="foo"
[async_insert](/operations/settings/settings.md)
```

#### link to an anchor within another doc {#link-to-an-anchor-within-another-doc}
#### Link to an anchor within another doc {#link-to-an-anchor-within-another-doc}

```md
[async_insert](/operations/settings/settings.md/#async-insert)
Expand Down Expand Up @@ -252,7 +252,7 @@ Some docs contain information for both Cloud and Self-managed ClickHouse, and so

Note: in the examples below you may notice that the H1 and H2 headers are outside of the tabs, the right-side "What's on this page" nav is built from the H1,2,3 headers in the main body of the markdown file, headings within the tabs are not currently included.

### Differences between Cloud and Self-managed {#differences-between-cloud-and-self-managed}
### Differences between Cloud and self-managed {#differences-between-cloud-and-self-managed}

Backup and restore are very different across Cloud and Self-managed as the target for the backup does not need to be specified, etc. The backup docs are an example where there is no content reused, so everything goes into one tab or the other. This is how the tabs are constructed:

Expand Down
14 changes: 7 additions & 7 deletions contribute/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ doc_type: 'reference' (or 'guide' or 'changelog')

### Associated markdown rule or CI check

#### front-matter validation
#### front-matter validation

There is a custom Docusaurus plugin which runs on build that makes the following
checks on front-matter:
Expand Down Expand Up @@ -249,7 +249,7 @@ imported by that page. Find the snippet location from the import statement at th
Docusaurus also has a built-in broken anchor checker. Unfortunately it sometimes
can give false positives.

### linking to spans
### Linking to spans

Sometimes you want to link to something other than a header. It is logical to
use a span for this purpose. For instance if you want to link to an image.
Expand Down Expand Up @@ -335,7 +335,7 @@ which may need versioned documentation, we use the following custom

The `ClientVersionDropdown` component supports two APIs:

#### API 1: Inline Content (Recommended)
#### API 1: inline content (recommended)

This approach keeps all content in the main file, which allows Docusaurus to properly generate the table of contents (TOC) for all versions.

Expand Down Expand Up @@ -375,7 +375,7 @@ Your v0.7.x content here...
- The TOC will show only headers from the currently selected version
- The component will display the first version as 'selected' by default

#### API 2: External Snippets (Legacy)
#### API 2: external snippets (legacy)

This approach uses separate snippet files for each version. Note that this method has limitations with TOC generation.

Expand Down Expand Up @@ -458,7 +458,7 @@ in your component configuration. For example:
- URL: `docs/api?v=v08`
- Matches: `version: 'v0.8+'` in your dropdown configuration

#### Conventions That Work
#### Conventions that work

- **Simple Version Strings**: Parameters like `?v=v08`, `?v=v07` work by
- matching against stripped versions of your configured version names.
Expand All @@ -471,7 +471,7 @@ in your component configuration. For example:
- **Preserving Other Parameters**: Other URL parameters are preserved when
switching versions.

#### What Won't Work
#### What won't work

- **Partial Matches**: `?v=8` won't match `v0.8` with the default implementation.

Expand All @@ -481,7 +481,7 @@ require more sophisticated matching logic. (Reach out to the docs team if requir
- **Non-Standard Formats**: Version formats not accounted for in the matching
logic might fail.

#### Best Practices
#### Best practices

1. Keep version strings in consistent formats for predictable results.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import NativeAdvancedDashboard from '@site/static/images/cloud/manage/monitoring
The ClickHouse data source plugin for Grafana enables visualization and exploration of data directly from ClickHouse using system tables. This approach works well for monitoring performance and creating custom dashboards for detailed system analysis.
For plugin installation and configuration details, see the ClickHouse [data source plugin](/integrations/grafana). For a complete monitoring setup using the Prometheus-Grafana mix-in with pre-built dashboards and alerting rules, see [Monitor ClickHouse with the new Prometheus-Grafana mix-in](https://clickhouse.com/blog/monitor-with-new-prometheus-grafana-mix-in).

### Direct Datadog Integration {#direct-datadog}
### Direct Datadog integration {#direct-datadog}

Datadog offers a Clickhouse Monitoring plugin for its agent which queries system tables directly. This integration provides comprehensive database monitoring with cluster awareness through clusterAllReplicas functionality.
:::note
Expand Down
2 changes: 1 addition & 1 deletion docs/_snippets/_users-and-roles-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Roles are used to define groups of users for certain privileges instead of manag

<VerticalStepper headerLevel="h5">

##### Log into the clickhouse client using the `clickhouse_admin` user {#login-admin-user}
##### Log into the ClickHouse client using the `clickhouse_admin` user {#login-admin-user}

```bash
clickhouse-client --user clickhouse_admin --password password
Expand Down
2 changes: 1 addition & 1 deletion docs/about-us/distinctive-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ClickHouse uses asynchronous multi-master replication. After being written to an

For more information, see the section [Data replication](../engines/table-engines/mergetree-family/replication.md).

## Role-Based Access Control {#role-based-access-control}
## Role-based access control {#role-based-access-control}

ClickHouse implements user account management using SQL queries and allows for [role-based access control configuration](/guides/sre/user-management/index.md) similar to what can be found in the ANSI SQL standard and popular relational database management systems.

Expand Down
2 changes: 1 addition & 1 deletion docs/best-practices/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ doc_type: 'landing-page'

import TableOfContents from '@site/docs/best-practices/_snippets/_table_of_contents.md';

# Best Practices in ClickHouse {#best-practices-in-clickhouse}
# Best practices in ClickHouse {#best-practices-in-clickhouse}

This section provides the best practices you will want to follow to get the most out of ClickHouse.

Expand Down
4 changes: 2 additions & 2 deletions docs/best-practices/minimize_optimize_joins.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Not all data needs to be denormalized — focus on the attributes that are frequ

For a full guide on denormalizing data in ClickHouse see [here](/data-modeling/denormalization).

## When JOINs are required {#when-joins-are-required}
## When joins are required {#when-joins-are-required}

When JOINs are required, ensure you're using **at least version 24.12 and preferably the latest version**, as JOIN performance continues to improve with each new release. As of ClickHouse 24.12, the query planner now automatically places the smaller table on the right side of the join for optimal performance — a task that previously had to be done manually. Even more enhancements are coming soon, including more aggressive filter pushdown and automatic re-ordering of multiple joins.

Expand All @@ -42,7 +42,7 @@ Follow these best practices to improve JOIN performance:
When using dictionaries for JOINs in ClickHouse, it's important to understand that dictionaries, by design, do not allow duplicate keys. During data loading, any duplicate keys are silently deduplicated—only the last loaded value for a given key is retained. This behavior makes dictionaries ideal for one-to-one or many-to-one relationships where only the latest or authoritative value is needed. However, using a dictionary for a one-to-many or many-to-many relationship (e.g. joining roles to actors where an actor can have multiple roles) will result in silent data loss, as all but one of the matching rows will be discarded. As a result, dictionaries are not suitable for scenarios requiring full relational fidelity across multiple matches.
:::

## Choosing the correct JOIN Algorithm {#choosing-the-right-join-algorithm}
## Choosing the correct join algorithm {#choosing-the-right-join-algorithm}

ClickHouse supports several JOIN algorithms that trade off between speed and memory:

Expand Down
4 changes: 2 additions & 2 deletions docs/best-practices/sizing-and-hardware-recommendations.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ For data warehousing workloads and ad-hoc analytical queries, we recommend the [

There is no standard CPU utilization target for ClickHouse. Utilize a tool such as [iostat](https://linux.die.net/man/1/iostat) to measure average CPU usage, and accordingly adjust the size of your servers to manage unexpected traffic spikes. However, for analytical or data warehousing use cases with ad-hoc queries, you should target 10-20% CPU utilization.

### How many CPU cores should I use? {#how-many-cpu-cores-should-i-use}
### How many CPU cores should i use? {#how-many-cpu-cores-should-i-use}

The number of CPUs you should use depends on your workload. However, we generally recommend the following memory-to-CPU-core ratios based on your CPU type:

Expand Down Expand Up @@ -164,7 +164,7 @@ To provide guidance (not recommendations), the following are example configurati
</tr>
</table>

### Fortune 500 Telecom Operator for a logging use case {#fortune-500-telecom-operator-for-a-logging-use-case}
### Fortune 500 telecom operator for a logging use case {#fortune-500-telecom-operator-for-a-logging-use-case}

<table>
<tr>
Expand Down
36 changes: 18 additions & 18 deletions docs/chdb/api/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ keywords: ['chdb', 'embedded', 'clickhouse-lite', 'python', 'api', 'reference']
doc_type: 'reference'
---

# Python API Reference
# Python API reference

## Core Query Functions {#core-query-functions}
## Core query functions {#core-query-functions}

### `chdb.query` {#chdb-query}

Expand Down Expand Up @@ -235,7 +235,7 @@ chdb.to_df(r)
0 1 hello
```

## Connection and Session Management {#connection-session-management}
## Connection and session management {#connection-session-management}

The following Session Functions are available:

Expand Down Expand Up @@ -331,7 +331,7 @@ Creating a new connection will close any existing connection.
- [`Connection`](#chdb-state-sqlitelike-connection) - Database connection class
- [`Cursor`](#chdb-state-sqlitelike-cursor) - Database cursor for DB-API 2.0 operations

## Exception Handling {#chdb-exceptions}
## Exception handling {#chdb-exceptions}

### **class** `chdb.ChdbError` {#chdb_chdbError}

Expand Down Expand Up @@ -698,7 +698,7 @@ id,name
- [`send_query()`](#chdb-session-session-send_query) - For streaming query execution
- [`sql`](#chdb-session-session-sql) - Alias for this method

## State Management {#chdb-state-management}
## State management {#chdb-state-management}

### `chdb.state.connect` {#chdb_state_connect}

Expand Down Expand Up @@ -1534,7 +1534,7 @@ text object
dtype: object
```

## DataFrame Integration {#dataframe-integration}
## DataFrame integration {#dataframe-integration}

### **class** `chdb.dataframe.Table` {#chdb-dataframe-table}

Expand All @@ -1544,7 +1544,7 @@ Bases:
class chdb.dataframe.Table(*args: Any, **kwargs: Any)
```

## Database API (DBAPI) 2.0 Interface {#database-api-interface}
## Database API (DBAPI) 2.0 interface {#database-api-interface}

chDB provides a Python DB-API 2.0 compatible interface for database connectivity, allowing you to use chDB with tools and frameworks that expect standard database interfaces.

Expand All @@ -1558,7 +1558,7 @@ The chDB DB-API 2.0 interface includes:

---

### Core Functions {#core-functions}
### Core functions {#core-functions}

The Database API (DBAPI) 2.0 Interface implements the following core functions:

Expand Down Expand Up @@ -1635,7 +1635,7 @@ chdb.dbapi.Binary(x)

---

### Connection Class {#connection-class}
### Connection class {#connection-class}

#### **class** `chdb.dbapi.connections.Connection(path=None)` {#chdb-dbapi-connections-connection}

Expand Down Expand Up @@ -1923,7 +1923,7 @@ transactions. Provided for DB-API 2.0 compliance.

---

### Cursor Class {#cursor-class}
### Cursor class {#cursor-class}

#### **class** `chdb.dbapi.cursors.Cursor` {#chdb-dbapi-cursors-cursor}

Expand Down Expand Up @@ -2351,7 +2351,7 @@ chDB automatically handles output sizing internally.

---

### Error Classes {#error-classes}
### Error classes {#error-classes}

Exception classes for chdb database operations.

Expand Down Expand Up @@ -2756,7 +2756,7 @@ This follows the Python DB API 2.0 specification for warning exceptions.

---

### Module Constants {#module-constants}
### Module constants {#module-constants}

#### `chdb.dbapi.apilevel = '2.0'` {#apilevel}

Expand Down Expand Up @@ -2817,7 +2817,7 @@ errors defaults to ‘strict’.

---

### Type Constants {#type-constants}
### Type constants {#type-constants}

#### `chdb.dbapi.STRING = frozenset({247, 253, 254})` {#string-type}

Expand Down Expand Up @@ -3099,7 +3099,7 @@ with dbapi.connect("test.chdb") as conn:
- Parameter binding syntax follows format style: `%s`
:::

## User-Defined Functions (UDF) {#user-defined-functions}
## User-defined functions (UDF) {#user-defined-functions}

User-defined functions module for chDB.

Expand Down Expand Up @@ -3347,9 +3347,9 @@ chdb.utils.infer_data_types`(column_data: Dict[str, List[Any]], n_rows: int = 10
|---------------|----------------------------------------------------------------------------|
| `List[tuple]` | A list of tuples, each containing a column name and its inferred data type |

## Abstract Base Classes {#abstract-base-classes}
## Abstract base classes {#abstract-base-classes}

### **class** `chdb.rwabc.PyReader`(data: Any)` {#pyreader}
### **class** `chdb.rwabc.PyReader`(data: any)` {#pyreader}

Bases: `ABC`

Expand Down Expand Up @@ -3422,7 +3422,7 @@ abstractmethod write(col_names: List[str], columns: List[List[Any]]) → None
| `col_names` | `List[str]` | List of column names that are being written |
| `columns` | `List[List[Any]]` | List of columns data, each column is represented by a list |

## Exception Handling {#exception-handling}
## Exception handling {#exception-handling}

### **class** `chdb.ChdbError` {#chdberror}

Expand Down Expand Up @@ -3469,7 +3469,7 @@ You should catch this exception when handling potentially failing
queries to provide appropriate error handling in your application.
:::

## Version Information {#version-information}
## Version information {#version-information}

### `chdb.chdb_version = ('3', '6', '0')` {#chdb-version}

Expand Down
2 changes: 1 addition & 1 deletion docs/chdb/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ We could write the following code:
df["likeDislikeRatio"] = df["likeCount"] / df["dislikeCount"]
```

## Querying a Pandas dataframe {#querying-a-pandas-dataframe}
## Querying a Pandas DataFrame {#querying-a-pandas-dataframe}

We can then query that DataFrame from chDB:

Expand Down
4 changes: 2 additions & 2 deletions docs/chdb/guides/query-remote-clickhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ sklearn_df.sort_values(by=["x"], ascending=False).head(n=10)
2383 2024-09-23 1777554
```

## Merging Pandas DataFrames {#merging-pandas-dataframes}
## Merging Pandas dataframes {#merging-pandas-dataframes}

We now have two DataFrames, which we can merge together based on date (which is the `x` column) like this:

Expand Down Expand Up @@ -166,7 +166,7 @@ df.head(n=5)
4 2018-03-02 5 23842 0.000210
```

## Querying Pandas DataFrames {#querying-pandas-dataframes}
## Querying Pandas dataframes {#querying-pandas-dataframes}

Next, let's say we want to find the dates with the best and worst ratios.
We can go back to chDB and compute those values:
Expand Down
4 changes: 2 additions & 2 deletions docs/chdb/guides/querying-pandas.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ match_id 3943077
Name: 0, dtype: object
```

## Querying Pandas DataFrames {#querying-pandas-dataframes}
## Querying Pandas dataframes {#querying-pandas-dataframes}

Next, let's see how to query these DataFrames using chDB.
We'll import the library:
Expand Down Expand Up @@ -279,7 +279,7 @@ LIMIT 10
9 Carlos Eccehomo Cuesta Figueroa 50
```

## Joining Pandas DataFrames {#joining-pandas-dataframes}
## Joining Pandas dataframes {#joining-pandas-dataframes}

We can also join DataFrames together in a query.
For example, to get an overview of the match, we could write the following query:
Expand Down
2 changes: 1 addition & 1 deletion docs/chdb/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ chDB has the following language bindings:
* [Bun](install/bun.md)
* [C and C++](install/c.md)

## How do I get started? {#how-do-i-get-started}
## How do i get started? {#how-do-i-get-started}

* If you're using [Go](install/go.md), [Rust](install/rust.md), [NodeJS](install/nodejs.md), [Bun](install/bun.md) or [C and C++](install/c.md), take a look at the corresponding language pages.
* If you're using Python, see the [getting started developer guide](getting-started.md) or the [chDB on-demand course](https://learn.clickhouse.com/user_catalog_class/show/1901178). There are also guides showing how to do common tasks like:
Expand Down
Loading