Git Product home page Git Product logo

clickhouse-docs's Introduction

Website CC BY-NC-SA 4.0 License Checks

The ClickHouse company logo.

ClickHouse® is an open-source column-oriented database management system that allows generating analytical data reports in real-time.


ClickHouse is blazing fast, but understanding ClickHouse and using it effectively is a journey. The documentation is your source for gaining the knowledge you need to be successful with your ClickHouse projects and applications. Head over to clickhouse.com/docs to learn more →

Table of contents

About this repo

This repository manages the documentation for ClickHouse. The content is built with Docusaurus and hosted on Vercel. Documentation content is written in Markdown and is held in the /docs directory.

Run locally

You can run a copy of this website locally within a few steps. Some folks find this useful when contributing so they can see precisely what their changes will look like on the production site.

  1. Install Git and NPM. If you already have them installed, skip this step:

    OS Package manager Install command
    MacOS Homebrew brew install git node
    Ubuntu Apt sudo apt install git nodejs npm
    Arch Pacman sudo pacman -S git nodejs npm
    Windows Chocolatey choco install git nodejs-lts
  2. Install yarn. If you already have it installed, skip this step:

    sudo npm install --global yarn
  3. Clone this repository and move into the clickhouse-docs directory:

    git clone https://github.com/clickhouse/clickhouse-docs
    cd clickhouse-docs
  4. Install the project dependencies with Yarn:

    yarn install
    
    # yarn install v1.22.19
    # [1/5] 🔍  Validating package.json...
    # [2/5] 🔍  Resolving packages...
    # ...
    # success Saved lockfile.
    # ✨  Done in 6.44s.
  5. Use Yarn to grab the latest documentation changes from the clickhouse/clickhouse repository:

    yarn prep-from-master
    
    # yarn run v1.22.19
    # Cloning into '/tmp/ch_temp_14714'...
    # ...
    # Prep completed
    # ✨  Done in 16.44s

    Alternatively, you can use a local copy of the clickhouse/clickhouse if you already have that repository cloned locally.

    yarn prep-from-local "/Users/johnny/clickhouse/"
    
    # yarn run v1.22.19
    # $ bash -c 'array_root=($npm ...
    # ...
    # Prep completed
    ✨  Done in 0.47s.
  6. Start the local web-server:

    yarn start
    
    # yarn run v1.22.19
    # $ docusaurus start
    # ...
    #

    This command will build the documentation site and serve it locally. Once the build has finished, browse the website at localhost:3000.

  7. To stop the local server, press ctrl + c in the terminal window.

If you want to build a static copy of this repository that doesn't require a constant server running to view, you can use yarn build instead of yarn start. The yarn build will output a static copy of the website in the /build directory. This process takes around 10 minutes to complete on an M1 Macbook with 8GB RAM.

Notes

Here are some things to keep in mind when building a local copy of the ClickHouse docs site.

Build-time

Due to the complex structure of this repo, the docs site can take some time to build locally. As a benchmark, it takes ~3 minutes to build on an M1 Macbook with 8GB RAM.

Redirects

Due to how the local server is built, redirects will not work. For example, visiting clickhouse.com/docs on the production site will lead you to clickhouse.com/docs/en/intro. However, on a local copy of the site, you will see a 404 page if you try to visit localhost:8000/docs.

Contributing

Want to help out? Contributions are always welcome! If you want to help out but aren't sure where to start, check out the issues board.

Pull requests

Please assign any pull request (PR) against an issue; this helps the docs team track who is working on what and what each PR is meant to address. If there isn't an issue for the specific thing you want to work on, quickly create one and comment so that it can be assigned to you. One of the repository maintainers will add you as an assignee.

Check out the GitHub docs for a refresher on how to create a pull request.

Tests and CI/CD

There are five workflows that run against PRs in this repo:

Name Description
Debug A debugging tool that prints environment variables and the content of the GITHUB_EVENT_PATH variable for each commit.
Link check Checks for broken external links in this repo.
Pull request This is a meta workflow that sets up a testing environment and calls the docs_check.py and finish_check.py scripts.
Scheduled Vercel build Builds the site every day at 00:10 UTC and hosts the build on Vercel.
Trigger build Uses the peter-evans/repository-dispatch@v2 workflow to create a repository dispatch.

Quick contributions

Have you noticed a typo or found some wonky formatting? For small contributions like these, it's usually faster and easier to make your changes directly in GitHub. Here's a quick guide to show you how the GitHub editor works:

  1. Each page in Clickhouse.com/docs has an Edit this page link at the bottom:

    The ClickHouse Docs website with the edit button highlighted.

    Click this button to edit this page in GitHub.

  2. Once you're in GitHub, click the pencil icon to edit this page:

  3. GitHub will fork the repository for you. This creates a copy of the clickhouse-docs repository on your personal GitHub account.

  4. Make your changes in the textbox. Once you're done, click Commit changes:

  5. In the Propose changes popup, enter a descriptive title to explain the changes you just made. Keep this title to 10 words or less. If your changes are fairly complex and need further explanation, enter your comments into the Extended description field.

  6. Make sure Create a new branch is selected, and click Propose changes:

  7. A new page should open with a new pull request. Double-check that the title and description are accurate.

  8. If you've spoken to someone on the docs team about your changes, tag them into the Reviewers section:

    If you haven't mentioned your changes to anyone yet, leave the Reviewers section blank.

  9. Click Create pull request.

At this point, your pull request will be handed over to the docs team, who will review it and suggest or make changes where necessary.

Issues

Found a problem with the Clickhouse docs site? Please raise an issue. Be as specific and descriptive as possible; screenshots help!

License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

clickhouse-docs's People

Contributors

alexey-milovidov avatar blinkov avatar danroscigno avatar dependabot[bot] avatar genzgd avatar gingerwizard avatar gjones avatar gmartinez-sisti avatar guykoh avatar johnnymatthews avatar justindeguzman avatar krithika-ch avatar leticiawebb avatar mrcrypster avatar mshustov avatar nellicus avatar paultagoras avatar pjhampton avatar rfraposa avatar rschu1ze avatar ryado avatar santrancisco avatar scottsnelgrove avatar slvrtrn avatar tbragin avatar tom-clickhouse avatar tpanetti avatar tsolodov avatar tylerhannan avatar vineethasok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clickhouse-docs's Issues

Explain how to connect to ClickHouse Cloud in JDBC integration page.

The JDBC url requires a special port and ssl parameter in order to connect to ClickHouse cloud.
And in slack channel for private preview customer the customer specifically asked for help because it is not so obvious how to connect to our cloud.

Therefore let's add a special cloud section to the Connecting Applications to ClickHouse with JDBC doc.

  • use screenshots from the control plane with the https connection values
  • give concrete java example program, e.g.
import com.clickhouse.jdbc.ClickHouseDataSource;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;

// connect to cloud instance
public class JDBC2CHCloud {
    public static void main(String[] args) throws Exception {

        String url = "jdbc:ch://yxaeq2tmh3.eu-west-1.aws.clickhouse.cloud:8443/default?ssl=true";

        ClickHouseDataSource dataSource = new ClickHouseDataSource(url);
        try (Connection connection = dataSource.getConnection("username", "pw");
             Statement statement = connection.createStatement();
             ResultSet resultSet = statement.executeQuery(" select * from system.tables limit 10")) {
            ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
            int columns = resultSetMetaData.getColumnCount();
            while (resultSet.next()) {
                for (int c = 1; c <= columns; c++) {
                    System.out.print(resultSetMetaData.getColumnName(c) + ":" + resultSet.getString(c) + (c < columns ? ", " : "\n"));
                }
            }
        }
    }
}

Improve the changelog.md CI

The changelog.md file is auto-generated and is not in the correct location for Docusaurus.

Also, the script generates a TOC that is no longer needed.

FAQ additions

  • How to choose a primary key?
  • How to add a column in ClickHouse?
  • Too many parts
  • How to filter ClickHouse table by an array column contents?
  • How to insert all rows from one table to another of identical structure?
  • How to kill a process (query) in ClickHouse?
  • How to implement pivot (like in pandas)?
  • How to remove the default ClickHouse user through users.d?
  • Importing MySQL dump to ClickHouse
  • Window function workarounds (row_number, lag/lead, running diff/sum/average)

PR workflow fails on PRs based on personal forks (vs. branches in this repo)

I am not a GitHub expert, but this looks to me like the workflow failed because my PR was based on a fork and not a local branch:

++ git branch --show-current
+ GIT_BRANCH=main
+ '[' reorder-example-datasets ']'
+ '[' reorder-example-datasets == main ']'
+ git fetch origin --depth=1 -- reorder-example-datasets:reorder-example-datasets
fatal: couldn't find remote ref reorder-example-datasets

I replaced the PR with another based on a branch created in this repo and it worked fine.

Store images in a separate repo

We used to have a separate repo with images for blog (immediately served via GitHub Pages on a separate domain without any CI/CD), we could do the same with guides images

Fix the 404.html page

The existing 404.html page appears to be using assets from the old /docs site (that is my theory at least)

User Guide on Zookeeper recovery

How to fix ZooKeeper issues where we need to detach and reload the parts. And also the issue where CH won't start because of an issue with a table definition in the /metadata folder

Manually update some missed commits to the historical docs

These three files were updated in the wrong format:

docs/en/sql-reference/functions/date-time-functions.md | 7 ++++
docs/en/sql-reference/functions/other-functions.md | 38 ++++++++++++++++++++
docs/ru/sql-reference/table-functions/postgresql.md | 2 +-

URL to References

It is currently /en/, but we could consider changing it to /references. It would require a very large number of redirect files.

Get the "edit" button to work

The docs are served up from two different repos, so the "edit" button is non-trivial. We will probably have to swizzle the component and customize.

Discuss use of partitioning on S3 page

@qoega I did not remove the partition by as we mention using the partitions when parallelizing writes to s3:

Note the use of partitioning on the pickup_date field. Whilst usually a technique to assist with data management, we can later use this key to parallelize writes to s3.

Can you please pop a note in here and we can discuss whether or not to make a change?

Add a dark mode option

We should consider modifying the CSS so that we can enable dark mode but still keep the CH look-and-feel. Who knows, it might look OK out-of-the-box! But I suspect we will need some design effort.

on main page, link to header documents goes to reference, old docs

selecting documents in header at base clickhouse.com directs to https://clickhouse.com/docs/en/ instead of new docs page.
Not sure if this is intentional by design or if the link is supposed to go to new docs landing page https://clickhouse.com/docs/intro, etc.
Screen Shot 2022-04-05 at 12 06 08 PM

Label settings that may need a server restart.

Some settings can be applied to specific queries using the SETTINGS keywords or the the current session using SET (eg. max_insert_threads). On the other hand, we can have settings that that must go into the profile and only takes effect on server restarts (eg. http_max_field_value_size , #36783).

We should distinguish these types of settings in the docs either grouping them into categories, or labelling the ones that require a server restart

Left nav corners are a bit off

Bottom end of the left menu. It does not combine well with the footer that is very light blue. The low contrast of white and very light blue does not combine well with the rounded corner of dark blue menu.

ORDER BY - case sensitive / ASCII order

One of our students asked a question in the Bootcamp about the case sensitivity of the ORDER BY clause on String values, related to this page:
https://clickhouse.com/docs/en/sql-reference/statements/select/order-by/

The assumption is that the ASCII order for Strings is used, although not specifically stated on this page. It is noted on this page that when using COLLATE, sorting is case-insensitive:
When using COLLATE, sorting is always case-insensitive.

However, to make this specifically clear, suggesting that we add a statement on the default String sort order.

Structure proposal: can we change the top level default to docs/en/

In looking at the way this is laid out, I'm wondering if we might better prepare for future growth by making the default location, in English, to the following:

https://clickhouse.com/docs/en/

In doing this, we could then essentially do a new build of the docs for each existing language:

https://clickhouse.com/docs/ru/
https://clickhouse.com/docs/zh/
https://clickhouse.com/docs/ja/

And in the near future, if we were to use DeepL or others to use machine translation:

https://clickhouse.com/docs/fr/
https://clickhouse.com/docs/kr/
https://clickhouse.com/docs/es/
https://clickhouse.com/docs/de/
...

This might mean building the whole Docusaurus set for each language, I'm not sure how that works exactly. Ideally from the default language page (redirected from https://clickhouse.com/docs/), there would be a language selection option in the upper right corner.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.