Skip to content

Commit 5dcd319

Browse files
authored
Merge pull request #1266 from Altinity/backports/25.8.13/89914
25.8.13 Backport of ClickHouse#89914 - Show datalake catalogs in SHOW DATABASES query
2 parents db73ca5 + 6bd16f8 commit 5dcd319

File tree

6 files changed

+79
-7
lines changed

6 files changed

+79
-7
lines changed

.github/workflows/master.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4178,7 +4178,7 @@ jobs:
41784178
secrets: inherit
41794179
with:
41804180
runner_type: altinity-on-demand, altinity-regression-tester
4181-
commit: c07440a1ad14ffc5fc49ce90dff2f40c2e5f364d
4181+
commit: f4c832bb4047e55544ebbf85a02c6364605117c9
41824182
arch: release
41834183
build_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
41844184
timeout_minutes: 300
@@ -4190,7 +4190,7 @@ jobs:
41904190
secrets: inherit
41914191
with:
41924192
runner_type: altinity-on-demand, altinity-regression-tester-aarch64
4193-
commit: c07440a1ad14ffc5fc49ce90dff2f40c2e5f364d
4193+
commit: f4c832bb4047e55544ebbf85a02c6364605117c9
41944194
arch: aarch64
41954195
build_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
41964196
timeout_minutes: 300

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4044,7 +4044,7 @@ jobs:
40444044
secrets: inherit
40454045
with:
40464046
runner_type: altinity-on-demand, altinity-regression-tester
4047-
commit: c07440a1ad14ffc5fc49ce90dff2f40c2e5f364d
4047+
commit: f4c832bb4047e55544ebbf85a02c6364605117c9
40484048
arch: release
40494049
build_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
40504050
timeout_minutes: 300
@@ -4056,7 +4056,7 @@ jobs:
40564056
secrets: inherit
40574057
with:
40584058
runner_type: altinity-on-demand, altinity-regression-tester-aarch64
4059-
commit: c07440a1ad14ffc5fc49ce90dff2f40c2e5f364d
4059+
commit: f4c832bb4047e55544ebbf85a02c6364605117c9
40604060
arch: aarch64
40614061
build_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
40624062
timeout_minutes: 300

.github/workflows/regression.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,76 @@ jobs:
10051005
name: ${{ env.SUITE }}-${{ matrix.STORAGE }}-${{ matrix.PART }}-${{ inputs.arch }}-artifacts
10061006
path: ${{ env.artifact_paths}}
10071007

1008+
S3Export:
1009+
if: |
1010+
fromJson(inputs.workflow_config).custom_data.ci_regression_jobs[0] == null ||
1011+
contains(fromJson(inputs.workflow_config).custom_data.ci_regression_jobs, 's3')
1012+
strategy:
1013+
fail-fast: false
1014+
matrix:
1015+
PART: [part, partition]
1016+
needs: [runner_labels_setup]
1017+
runs-on: ${{ fromJson(needs.runner_labels_setup.outputs.runner_labels) }}
1018+
timeout-minutes: ${{ inputs.timeout_minutes }}
1019+
steps:
1020+
- name: Checkout regression repo
1021+
uses: actions/checkout@v4
1022+
with:
1023+
repository: Altinity/clickhouse-regression
1024+
ref: ${{ inputs.commit }}
1025+
- name: Set envs
1026+
run: |
1027+
cat >> "$GITHUB_ENV" << 'EOF'
1028+
REPORTS_PATH=${{ runner.temp }}/reports_dir
1029+
SUITE=s3
1030+
PART=${{ matrix.PART }}
1031+
EOF
1032+
- name: Setup
1033+
run: .github/setup.sh
1034+
- name: Get deb url
1035+
env:
1036+
S3_BASE_URL: https://altinity-build-artifacts.s3.amazonaws.com/
1037+
PR_NUMBER: ${{ github.event.pull_request.number || 0 }}
1038+
run: |
1039+
mkdir -p $REPORTS_PATH
1040+
cat > $REPORTS_PATH/workflow_config.json << 'EOF'
1041+
${{ inputs.workflow_config }}
1042+
EOF
1043+
1044+
python3 .github/get-deb-url.py --github-env $GITHUB_ENV --workflow-config $REPORTS_PATH/workflow_config.json --s3-base-url $S3_BASE_URL --pr-number $PR_NUMBER --branch-name ${{ github.ref_name }} --commit-hash ${{ inputs.build_sha }} --binary
1045+
1046+
- name: Run ${{ env.SUITE }} suite
1047+
id: run_suite
1048+
run: EXITCODE=0;
1049+
python3
1050+
-u ${{ env.SUITE }}/regression.py
1051+
--clickhouse-binary-path ${{ env.clickhouse_path }}
1052+
--storage minio
1053+
--attr project="$GITHUB_REPOSITORY" project.id="$GITHUB_REPOSITORY_ID" package="${{ env.clickhouse_path }}" version="${{ env.version }}" user.name="$GITHUB_ACTOR" repository="https://github.com/Altinity/clickhouse-regression" commit.hash="$(git rev-parse HEAD)" job.name="$GITHUB_JOB (${{ matrix.PART }})" job.retry=$GITHUB_RUN_ATTEMPT job.url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" arch="$(uname -i)"
1054+
--only ":/try*" "minio/export tests/export ${{ matrix.PART }}/*"
1055+
${{ env.args }} || EXITCODE=$?;
1056+
.github/add_link_to_logs.sh;
1057+
exit $EXITCODE
1058+
- name: Set Commit Status
1059+
if: always()
1060+
run: python3 .github/set_builds_status.py
1061+
env:
1062+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1063+
JOB_OUTCOME: ${{ steps.run_suite.outcome }}
1064+
SUITE_NAME: "Regression ${{ inputs.arch }} S3 Export ${{ matrix.PART }}"
1065+
- name: Create and upload logs
1066+
if: always()
1067+
run: .github/create_and_upload_logs.sh 1
1068+
- name: Upload logs to regression results database
1069+
if: always()
1070+
timeout-minutes: 20
1071+
run: .github/upload_results_to_database.sh 1
1072+
- uses: actions/upload-artifact@v4
1073+
if: always()
1074+
with:
1075+
name: ${{ env.SUITE }}-export-${{ matrix.PART }}-${{ inputs.arch }}-artifacts
1076+
path: ${{ env.artifact_paths}}
1077+
10081078
TieredStorage:
10091079
if: |
10101080
fromJson(inputs.workflow_config).custom_data.ci_regression_jobs[0] == null ||

ci/praktika/yaml_additional_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AltinityWorkflowTemplates:
3535
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
3636
"""
3737
# Additional jobs
38-
REGRESSION_HASH = "c07440a1ad14ffc5fc49ce90dff2f40c2e5f364d"
38+
REGRESSION_HASH = "f4c832bb4047e55544ebbf85a02c6364605117c9"
3939
ALTINITY_JOBS = {
4040
"GrypeScan": r"""
4141
GrypeScanServer:

src/Interpreters/InterpreterShowTablesQuery.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ BlockIO InterpreterShowTablesQuery::execute()
232232
}
233233
auto rewritten_query = getRewrittenQuery();
234234
String database = getContext()->resolveDatabase(query.getFrom());
235-
if (DatabaseCatalog::instance().isDatalakeCatalog(database))
235+
if (query.databases || DatabaseCatalog::instance().isDatalakeCatalog(database))
236236
{
237237
auto context_copy = Context::createCopy(getContext());
238-
/// HACK To always show them in explicit "SHOW TABLES" queries
238+
/// HACK To always show them in explicit "SHOW TABLES" and "SHOW DATABASES" queries
239239
context_copy->setSetting("show_data_lake_catalogs_in_system_tables", true);
240240
return executeQuery(rewritten_query, context_copy, QueryFlags{ .internal = true }).second;
241241
}

tests/integration/test_database_glue/test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ def test_system_tables(started_cluster):
617617
node.query(f"SELECT count() FROM {CATALOG_NAME}.`{namespace}.{table_name}`")
618618
)
619619

620+
assert CATALOG_NAME in node.query("SHOW DATABASES")
621+
assert table_name in node.query(f"SHOW TABLES FROM {CATALOG_NAME}")
620622
# system.tables
621623
assert int(node.query(f"SELECT count() FROM system.tables WHERE database = '{CATALOG_NAME}' and table ilike '%{root_namespace}%' SETTINGS show_data_lake_catalogs_in_system_tables = true").strip()) == 4
622624
assert int(node.query(f"SELECT count() FROM system.tables WHERE database = '{CATALOG_NAME}' and table ilike '%{root_namespace}%'").strip()) == 0

0 commit comments

Comments
 (0)