Skip to content

Add table sampling with fixed shard#15128

Closed
takaaki7 wants to merge 4 commits intoapache:masterfrom
takaaki7:add_table_sampling
Closed

Add table sampling with fixed shard#15128
takaaki7 wants to merge 4 commits intoapache:masterfrom
takaaki7:add_table_sampling

Conversation

@takaaki7
Copy link

@takaaki7 takaaki7 commented Oct 11, 2023

Fixes #15140 .

Description

Add fixed shard table sampling for native query. The details is described in issue.

Release note


Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@takaaki7 takaaki7 changed the title Add table sampling Add table sampling with fixed shard Oct 12, 2023
{
if (baseDataSource instanceof TableDataSource) {
return Optional.of((TableDataSource) baseDataSource);
} else if (baseDataSource instanceof SampledTableDataSource) {

Check failure

Code scanning / CodeQL

Contradictory type checks

This access of [baseDataSource](1) cannot be of type [SampledTableDataSource](2), since [this expression](3) ensures that it is not of type [TableDataSource](4).
if (baseDataSource instanceof TableDataSource) {
return Optional.of((TableDataSource) baseDataSource);
} else if (baseDataSource instanceof SampledTableDataSource) {
return Optional.of((SampledTableDataSource) baseDataSource);

Check failure

Code scanning / CodeQL

Contradictory type checks

This access of [baseDataSource](1) cannot be of type [SampledTableDataSource](2), since [this expression](3) ensures that it is not of type [TableDataSource](4).
public boolean isTableBased()
{
return (baseDataSource instanceof TableDataSource
|| baseDataSource instanceof SampledTableDataSource

Check failure

Code scanning / CodeQL

Contradictory type checks

This access of [baseDataSource](1) cannot be of type [SampledTableDataSource](2), since [this expression](3) ensures that it is not of type [TableDataSource](4).
@takaaki7 takaaki7 closed this by deleting the head repository Oct 31, 2023
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.

[Proposal] Fixed-shard table sampling

1 participant