[BEAM-2528] BeamSQL DDL :: CreateTable#4041
Closed
xumingming wants to merge 1 commit intoapache:masterfrom
Closed
Conversation
Contributor
Author
|
R: @takidau |
813b9a7 to
1da0964
Compare
mingmxu
reviewed
Nov 1, 2017
mingmxu
left a comment
There was a problem hiding this comment.
Thanks @xumingming to bring back this topic, starting to read the code
|
overall it's great for DDL support. One minor opinion that, can we change |
|
retest this please |
Contributor
Author
|
I agree with you, use a dedicated syntax to denote the type of table will be more extensible, how about a keyword like |
661ad4c to
44a6249
Compare
Contributor
Author
|
Rebased & added |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I started this PR as an initial attempt to implement the BeamSQL
create tablestatement. The implementation might not be so mature, but I hope this could be a place we can discuss deeper about the create table. I will introduce this PR in the following 3 aspects:MetaStore
Metastore is responsible for handling the CRUD of table during a session. e.g. create a table, query all tables, query a table by the specified name etc. When a table is created, the table meta info can be persisted by the metastore, but the default
InMemoryMetaStorewill only store the meta info in memory, so it will NOT be persisted, but user can implement theMetaStoreinterface to make a persistent implementation.The table names in MetaStore need to be unique.
TableProvider
The tables in MetaStore can come from many different sources, the construction of a usable table is the responsibility of a
TableProvider, TableProvider have the similar interface likeMetaStore, but it only handles a specific type of table, e.g.TextTableProvideronly handle text tables, whileKafakaTableProvideronly handle kafka tables.In this PR, only
TextTableProviderandKafakaTableProviderare implemented as example.Grammar
The grammar for create a TEXT table is:
LOCATIONdictates where the data of the table is stored. The scheme of the LOCATION dictate the table type, e.g. in the above example, the table type istext, using the table type we can find the correspondingTextTableProviderusing the ServiceLoader merchanism.TBLPROPERTIESis used to specify some other properties of the table, in the above example, we specified the format of each line of text file:Excel(one variant of CSV format).The grammar for create a KAFKA table is: