Skip to content

[hotfix][table-planner] HiveCatalog store filesystem connector partit…#28516

Open
yangxiao0320 wants to merge 1 commit into
apache:masterfrom
yangxiao0320:master
Open

[hotfix][table-planner] HiveCatalog store filesystem connector partit…#28516
yangxiao0320 wants to merge 1 commit into
apache:masterfrom
yangxiao0320:master

Conversation

@yangxiao0320

Copy link
Copy Markdown

…ioned tables, FlinkRecomputeStatistics cannot recognize the partition in batch mode

What is the purpose of the change

HiveCatalog store filesystem connector partitioned tables, FlinkRecomputeStatistics cannot recognize the partition in batch mode

write data

CREATE CATALOG MyCatalog
WITH (
'type' = 'hive',
'hive-conf-dir' = '/opt/client/Hive/config',
'hive-version' = '3.1.0'
);

USE CATALOG MyCatalog;

create table test_filesystem(
uuid varchar(20),
name varchar(10),
dt varchar(20)
)
PARTITIONED BY (dt)
with (
'connector' = 'filesystem',
'path' = 'hdfs://hacluster/tmp/test_filesystem',
'format'= 'parquet'
);

CREATE TABLE datagen (
uuid varchar(20),
name varchar(10),
dt varchar(20))
WITH (
'connector' = 'datagen',
'number-of-rows' = '10');

insert into test_filesystem select * from datagen;

read data

set execution.runtime-mode=batch;

select * from test_filesystem;

[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.catalog.exceptions.TableNotPartitionedException: Table default.test_filesystem in catalog MyCatalog is not partitioned.

Brief change log

When FlinkRecomputeStatistics cannot obtain the partition, the statistics information is set to UNKNOWN.

Verifying this change

Please make sure both new and modified tests in this PR follow the conventions for tests defined in our code quality guide.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (100MB)
  • Extended integration test for recovery after master (JobManager) failure
  • Added test that validates that TaskInfo is transferred only once across recoveries
  • Manually verified the change by running a 4 node cluster with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

…ioned tables, FlinkRecomputeStatistics cannot recognize the partition in batch mode
@flinkbot

flinkbot commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@spuru9

spuru9 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

A few points before the review:

  1. Per AGENTS.md, [hotfix] is only for typo/doc fixes that need no JIRA — a behavioral planner fix like this a JIRA would be helpful for dumping the info in your description.
  2. The PR description is not yet complete, can you check the guidelines and fix that.
  3. Silently dropping to UNKNOWN here means stats just vanish with no trace when Flink and the catalog disagree about partitioning. At least a log would help.
  4. Optional: Some test affirming the behaviour.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants