-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[FLINK-27752] Change 'path' to 'root-path' in table store #136
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
Conversation
| import static org.apache.flink.table.store.log.LogStoreTableFactory.discoverLogStoreFactory; | ||
|
|
||
| /** Abstract table store factory to create table source and table sink. */ | ||
| public abstract class AbstractTableStoreFactory |
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.
Extract from TableStoreFactory.
| import static org.apache.flink.table.store.log.LogOptions.LOG_PREFIX; | ||
|
|
||
| /** Default implementation of {@link ManagedTableFactory}. */ | ||
| public class TableStoreManagedFactory extends AbstractTableStoreFactory |
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.
Rename from TableStoreFactory.
| } | ||
| }); | ||
|
|
||
| String rootPath = enrichedOptions.remove(ROOT_PATH.key()); |
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.
Enrich path and topic.
| Map<String, String> options = new HashMap<>(context.getCatalogTable().getOptions()); | ||
| Preconditions.checkArgument( | ||
| !options.containsKey(TOPIC.key()), | ||
| "Managed table can not contains custom topic. " |
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.
contain
| return map; | ||
| } | ||
|
|
||
| @Test |
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.
Nit: put tests together
LadyForest
left a comment
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.
Thanks for the contribution! Looks good in general, and I only left some minor comments.
LadyForest
left a comment
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.
LGTM, +1 to merge :)
The path is easy to bother the user, he/she will misinterpret it as path of table.
Let's change it to root-path, and it will be clearer.
pathtoroot-path.AbstractTableStoreFactory.pathas table path. Table Path will be generated inenrichOptions.LogStoreTableFactory.enrichOptions.It is equivalent to solidifying the
pathandtopicwhenenrichOptions, so that subsequent queries and writes can use them directly.This allows us to have a richer strategy for
path/topicgeneration, rather than being tied to generating paths based ontableIdentifier.