Skip to content

Add LookupJoinableFactory.#9281

Merged
gianm merged 8 commits intoapache:masterfrom
gianm:lookup-joinable-factory
Jan 30, 2020
Merged

Add LookupJoinableFactory.#9281
gianm merged 8 commits intoapache:masterfrom
gianm:lookup-joinable-factory

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Jan 29, 2020

Enables joins where the right-hand side is a lookup. Includes an
integration test.

Also, includes changes to LookupExtractorFactoryContainerProvider:

  1. Add "getAllLookupNames", which will be needed to eventually connect
    lookups to Druid's SQL catalog.
  2. Convert "get" from nullable to Optional return.
  3. Swap out most usages of LookupReferencesManager in favor of the
    simpler LookupExtractorFactoryContainerProvider interface.

Enables joins where the right-hand side is a lookup. Includes an
integration test.

Also, includes changes to LookupExtractorFactoryContainerProvider:

1) Add "getAllLookupNames", which will be needed to eventually connect
   lookups to Druid's SQL catalog.
2) Convert "get" from nullable to Optional return.
3) Swap out most usages of LookupReferencesManager in favor of the
   simpler LookupExtractorFactoryContainerProvider interface.
Map<Class<? extends DataSource>, JoinableFactory> joinableFactories =
injector.getInstance(Key.get(new TypeLiteral<Map<Class<? extends DataSource>, JoinableFactory>>() {}));
Assert.assertEquals(1, joinableFactories.size());
Assert.assertEquals(2, joinableFactories.size());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you want to add a similar assert below for LookupJoinableFactory?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, that sounds good, I'll add one in a followup.

Map<Class<? extends DataSource>, JoinableFactory> joinableFactories =
injector.getInstance(Key.get(new TypeLiteral<Map<Class<? extends DataSource>, JoinableFactory>>() {}));
Assert.assertEquals(2, joinableFactories.size());
Assert.assertEquals(3, joinableFactories.size());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe JoinableFactoryModule.FACTORY_MAPPINGS can be made visible for testing so that this can be changed to FACTORY_MAPPINGS.size() + 1 and the test does not need to updated again if another default mapping is added later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds reasonable, I'll add that in the same followup.

@gianm gianm merged commit 204ba99 into apache:master Jan 30, 2020
@gianm gianm deleted the lookup-joinable-factory branch January 30, 2020 23:01
@jihoonson jihoonson added this to the 0.18.0 milestone Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants