[BEAM-2528] BeamSql: DDL: create table#3481
[BEAM-2528] BeamSql: DDL: create table#3481xumingming wants to merge 7 commits intoapache:DSL_SQLfrom
Conversation
|
About "how to tell whether a table is bounded or unbounded", my current thinking is using the location scheme, e.g. |
|
Entry point of the new feature is: |
9bbb08f to
1f9c423
Compare
mingmxu
left a comment
There was a problem hiding this comment.
As there's a schema header in location, that could tell whether it's BOUNDED or UNBOUNDED I think. For example text(refer to TextIO) is always BOUNDED, and Kafka(refer to KafkaIO) may be BOUNDED or UNBOUNDED depends on TBLPROPERTIES.
|
would like to understand the definition of In my mind,
|
|
Agree with @xumingmin that use |
|
01c37d0 to
23f41ab
Compare
|
retest this please |
|
@xumingming can you rebase this PR? |
601bc13 to
1b52f0a
Compare
|
retest this please. |
|
Rebased & ignored findbugs and javadoc plugin for auto-generated parser classes. |
ae53639 to
184aa0f
Compare
|
Rebased with the lastest DSL_SQL branch. |
|
R: @takidau |
|
Closing this one, will open another PR. |
I started this PR as an initial attempt to implement the
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.Grammar
The grammar for create 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).