-
Notifications
You must be signed in to change notification settings - Fork 76
allow macros in cluster name in Distributed engine #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
allow macros in cluster name in Distributed engine #400
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables support for macros in cluster names within the Distributed engine for ClickHouse Spark connector. It addresses issue #362 where distributed tables using macro substitution (e.g., {cluster}
) in cluster names were not properly resolved.
- Added macro querying and resolution functionality to handle macro substitution in cluster names
- Introduced
MacrosSpec
case class andqueryMacrosSpec()
method to fetch macros from ClickHouse - Updated
resolveTableCluster
method to support macro substitution before cluster resolution
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
ClickHouseHelper.scala | Adds queryMacrosSpec() method to query system.macros table |
ClickHouseCatalog.scala | Integrates macro specs collection and passes to cluster resolution |
TableEngineUtils.scala | Implements macro substitution logic in resolveTableCluster method |
MacrosSpec.scala | New case class to represent macro name-substitution pairs |
TableEngineUtilsSuite.scala | Unit test for macro-based cluster resolution |
SparkClickHouseClusterTest.scala | Test helper for distributed tables with macros |
ClickHouseClusterReadSuite.scala | Integration test for distributed table reads with macros |
macros.xml files | Test configuration adding cluster macro definitions |
NodeSpecHelper.scala | Test helper updates to support macro testing |
clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineUtils.scala
Outdated
Show resolved
Hide resolved
clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineUtils.scala
Outdated
Show resolved
Hide resolved
clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineUtils.scala
Outdated
Show resolved
Hide resolved
…EngineUtils.scala Co-authored-by: Copilot <[email protected]>
…EngineUtils.scala Co-authored-by: Copilot <[email protected]>
Hi peeps, wanted to check in on the status of a maintainer taking a look at this change :) Thank you for the work @crazy-genius |
@Korg95 Yes, we should be able to address it in the coming days. |
@Korg95 , @BentsiLeviav |
Summary
I have fixed issue with distributed table read within spark catalog api
:see original issue #362