Strictly speaking, they are not necessarily tables either. We could also introduce something like CREATE EXTERNAL DATA SOURCE (a-la T-SQL <https://docs.microsoft.com/en-us/sql/t-sql/statements/create-external-data-source-transact-sql?view=sql-server-2017>), if it's somehow advantageous for us to leverage access patterns or restrict DML statements.
I think your idea of CREATE EXTERNAL TABLE is practical :) On Mon, Aug 13, 2018 at 2:12 PM Rui Wang <[email protected]> wrote: > Hi Community, > > BeamSQL allows CREATE TABLE > <https://beam.apache.org/documentation/dsls/sql/create-table/> statements > to register virtual tables from external storage systems (e.g. BigQuery). > > BeamSQL is not a storage system, so any table registered by "CREATE TABLE" > statement is essentially equivalent to be registered by "CREATE EXTERNAL > TABLE", which requires the user to provide a LOCATION and BeamSQL will > register the table outside of current execution environment based on > LOCATION. > > So I propose to add EXTERNAL keyword to "CREATE TABLE" in BeamSQL to help > users understand they are registering tables, and BeamSQL does not create > non existing tables by running CREATE TABLE (at least on some storage > systems, if not all). > > We can make the EXTERNAL keyword either required or optional. > > If we make the EXTERNAL keyword required: > > Pros: > a. We can get rid of the registering table semantic on CREATE TABLE. > b, We keep the room that we could add CREATE TABLE back in the future if > we want CREATE TABLE to create, rather than not only register tables in > BeamSQL. > > Cons: > 1. CREATE TABLE syntax will not be supported so existing BeamSQL pipelines > which has CREATE TABLE require changes. > 2. It's required to type tedious EXTERNAL keyword every time, especially > in SQL Shell. > > If we make the EXTERNAL keyword optional, we will have reversed pros and > cons above. > > Any thoughts on adding EXTERNAL keyword, and make it required or optional? > > > Thanks, > Rui > > >
smime.p7s
Description: S/MIME Cryptographic Signature
