Skip to content

Antalya-26.3 Frontport of #1659 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks#1723

Open
mkmkme wants to merge 2 commits intoantalya-26.3from
frontport/antalya-26.3/hybrid-move-watermark
Open

Antalya-26.3 Frontport of #1659 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks#1723
mkmkme wants to merge 2 commits intoantalya-26.3from
frontport/antalya-26.3/hybrid-move-watermark

Conversation

@mkmkme
Copy link
Copy Markdown
Collaborator

@mkmkme mkmkme commented May 2, 2026

Antalya 26.1 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks

Changelog category (leave one):

  • New Feature

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

Added support for moving Hybrid table watermarks (#1659 by @mkmkme)

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

Antalya 26.1 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks
@mkmkme mkmkme added antalya hybrid antalya-26.3 forwardport This is a frontport of code that existed in previous Antalya versions labels May 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Workflow [PR], commit [488e6af]

const ASTPtr & base_predicate, const std::vector<StorageDistributed::HybridSegment> & segs)
{
std::unordered_map<String, String> result;
std::function<void(const ASTPtr &)> walk = [&](const ASTPtr & node)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This function looks very similar to replace_hybrid_params, maybe there is a way to reduce the code duplication?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see this function only validates it, which seems to be a copy and paste of replace_hybrid_params without the replace logic. Maybe you can clone the original ast and just call replace? This will also make the maintainance better

const auto & param_name = name_lit->value.safeGet<String>();
const auto & type_name = type_lit->value.safeGet<String>();

if (!watermark_snapshot)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can't this be checked on line 1234? Right after auto watermark_snapshot = hybrid_watermark_params.get();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It can, but in this case we won't have a watermark name to put into the exception message



/// Extract declared hybridParam types from all Hybrid predicate ASTs.
static std::unordered_map<String, String> collectHybridParamTypes(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does it really extract types? It seems to me it actually builds a map from the hybrid args, not only type names.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The map stores {name1: type1, ...} so I don't really see the conflict here. I mean, yeah, it does build a map for the hybrid args, but it's only the mapping from the name to the type.

Comment on lines +2790 to +2807
if (auto * func = node->as<ASTFunction>(); func && func->name == "hybridParam")
{
auto * arg_list = func->arguments ? func->arguments->as<ASTExpressionList>() : nullptr;
if (!arg_list || arg_list->children.size() != 2)
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"hybridParam() requires exactly 2 arguments: (name, type)");

auto * name_lit = arg_list->children[0]->as<ASTLiteral>();
auto * type_lit = arg_list->children[1]->as<ASTLiteral>();
if (!name_lit || name_lit->value.getType() != Field::Types::String)
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"hybridParam() first argument (name) must be a string literal");
if (!type_lit || type_lit->value.getType() != Field::Types::String)
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"hybridParam() second argument (type) must be a string literal");

const auto & param_name = name_lit->value.safeGet<String>();
const auto & type_name = type_lit->value.safeGet<String>();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IMHO we should abstract away these checks. Searching for type_lit->value.getType() != Field::Types::String shows 3 occurrences.

@svb-alt svb-alt added the port-antalya PRs to be ported to all new Antalya releases label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

antalya antalya-26.3 forwardport This is a frontport of code that existed in previous Antalya versions hybrid port-antalya PRs to be ported to all new Antalya releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants