Skip to content

Step1: Paimon table function support - #84423

Merged
hanfei1991 merged 73 commits into
ClickHouse:masterfrom
JiaQiTang98:paimon-support
Oct 15, 2025
Merged

hanfei1991 merged 73 commits into
ClickHouse:masterfrom
JiaQiTang98:paimon-support

Conversation

@JiaQiTang98

@JiaQiTang98 JiaQiTang98 commented Jul 25, 2025 •

Copy link
Copy Markdown
Contributor

Introduce Paimon datalake support

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add support for querying Apache Paimon in ClickHouse. This integration would enable ClickHouse users to directly interact with Paimon's data lake storage.

https://paimon.apache.org/
Apache Paimon is a data lake engine open-sourced by the Flink team. It has excellent compatibility with Flink and currently boasts numerous user cases worldwide.

  • Table Function: Implement table functions to allow ClickHouse to query Paimon tables seamlessly.
  • REST-based Paimon Database in Clickhouse(like Iceberg Database).
  • Partition Pruning
  • Metadata cache

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh

clickhouse-gh Bot commented Jul 25, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ba91539]

Summary: ✅

@JiaQiTang98 JiaQiTang98 changed the title Paimon support WIP: Paimon support Jul 25, 2025
@JiaQiTang98 JiaQiTang98 reopened this Jul 25, 2025
@JiaQiTang98
JiaQiTang98 marked this pull request as draft July 25, 2025 05:57
@JiaQiTang98 JiaQiTang98 added the can be tested Allows running workflows for external contributors label Jul 25, 2025
@JiaQiTang98 JiaQiTang98 reopened this Jul 25, 2025
@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label Jul 25, 2025
@hanfei1991

Copy link
Copy Markdown
Member

@JiaQiTang98 Could we add a doc for Paimon support? and add a README in tests/queries/0_stateless/data_minio/paimon_all_types about how the data is generated

@JiaQiTang98

Copy link
Copy Markdown
Contributor Author

@JiaQiTang98 Could we add a doc for Paimon support? and add a README in tests/queries/0_stateless/data_minio/paimon_all_types about how the data is generated

Great Idea, i will add it later

@JiaQiTang98
JiaQiTang98 force-pushed the paimon-support branch 3 times, most recently from 8617300 to 88ebf6a Compare July 29, 2025 02:41
@JiaQiTang98

Copy link
Copy Markdown
Contributor Author

@hanfei1991 The user document and the document on how to generate Paimon format data have been completed

@JiaQiTang98 JiaQiTang98 changed the title WIP: Paimon support step1: Paimon table function support Aug 13, 2025
@JiaQiTang98 JiaQiTang98 added the comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. label Aug 13, 2025
@JiaQiTang98
JiaQiTang98 marked this pull request as ready for review August 13, 2025 14:47
@JiaQiTang98

Copy link
Copy Markdown
Contributor Author

And I think it would be better to place other features of Paimon in other PRs instead; the PR just implements table functions.

@JiaQiTang98 JiaQiTang98 changed the title step1: Paimon table function support Step1: Paimon table function support Aug 13, 2025
@hanfei1991 hanfei1991 self-assigned this Aug 13, 2025
@JiaQiTang98
JiaQiTang98 force-pushed the paimon-support branch 6 times, most recently from 67bfcbd to 4a5e236 Compare August 19, 2025 03:54
@JiaQiTang98

Copy link
Copy Markdown
Contributor Author

@hanfei1991 It seems there are some flaky tests not related to the PR. And I think we could start the review?

else if (real_type.starts_with("TIME") && !real_type.starts_with("TIMESTAMP"))
{
type.root_type = RootDataType::TIME_WITHOUT_TIME_ZONE;
type.clickhouse_data_type = std::make_shared<DataTypeInt64>();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map time to Int64, like Iceberg

namespace Paimon
{

inline UInt64 flipBytes(UInt64 value)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/ClickHouse/ClickHouse/blob/master/base/poco/Foundation/include/Poco/Types.h#L39-L47
In Poco, it typedef unsigned long to UInt64, however ClickHouse always typedef uint64_t(unsigned long long) to UInt64.
Maybe we should perform a cast when calling Poco::ByteOrder::flipBytes instead of defining a new function?

}
for (const auto & manifest_meta : delta_manifest_list)
{
delta_manifest.emplace_back(table_client_ptr->getDataManifest(manifest_meta.file_name, *table_schema, PARTITION_DEFAULT_NAME));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct PaimonDefinition
{
static constexpr auto name = "paimon";
static constexpr auto storage_engine_name = S3Definition::storage_engine_name;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paimon Storage Engine is not implemented in this PR, so I use S3 as storage_engine_name to work around getSourceAccessObject

@JiaQiTang98

Copy link
Copy Markdown
Contributor Author

Stateless tests (amd_binary, ParallelReplicas, s3 storage, parallel) failure
Stress test (amd_debug) failure
AST fuzzer (arm_asan) failure

#87653

Integration tests (arm_binary, distributed plan, 1/4) failure
test_storage_rabbitmq/test.py::test_rabbitmq_hash_exchange FAIL
test_storage_rabbitmq/test.py::test_rabbitmq_topic_exchange FAIL

#71049

@hanfei1991

Copy link
Copy Markdown
Member

@JiaQiTang98 the interface of IDataLakeMetadata has changed, so the build has failed, please fix it.

the rest LGTM

@JiaQiTang98

Copy link
Copy Markdown
Contributor Author

Could we add this PR to merge queue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. pr-feature Pull request with new product feature pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants