joellubi commented on PR #38385:
URL: https://github.com/apache/arrow/pull/38385#issuecomment-1815174413

   @lidavidm @emkornfield How is this?
   ```proto
   message CommandStatementIngest {
     option (experimental) = true;
   
     // Options for table definition behavior
     message TableCreationOptions {
       // The action to take if the target table does not exist
       enum TableNotExistOption {
         // Do not use. Servers should error if this is specified by a client.
         TABLE_NOT_EXIST_OPTION_UNSPECIFIED = 0;
         // Create the table if it does not exist
         TABLE_NOT_EXIST_OPTION_CREATE = 1;
         // Fail if the table does not exist
         TABLE_NOT_EXIST_OPTION_FAIL = 2;
       }
       // The action to take if the target table already exists
       enum TableExistsOption {
         // Do not use. Servers should error if this is specified by a client.
         TABLE_EXISTS_OPTION_UNSPECIFIED = 0;
         // Fail if the table already exists
         TABLE_EXISTS_OPTION_FAIL = 1;
         // Append to the table if it already exists
         TABLE_EXISTS_OPTION_APPEND = 2;
         // Drop and recreate the table if it already exists
         TABLE_EXISTS_OPTION_REPLACE = 3;
       }
   
       TableNotExistOption if_not_exist = 1;
       TableExistsOption if_exists = 2;
     }
   
     TableCreationOptions table_creation_options = 1;
     string table = 2;
     optional string schema = 3;
     optional string catalog = 4;
     bool temporary = 5;
     optional bytes transaction_id = 6;
     map<string, string> options = 1000;
   }
   ```
   
   I'm also thinking TableCreationOptions could be Table**Definition**Options. 
Feels a little more generically related to DDL (but not explicitly related to 
SQL).
   
   > IMO, optional in Protobuf is purely semantics for the human reader. It 
will still default to false. (It also changes codegen to expose a flag.) We can 
remove it, but it by no means needs to be set either way.
   
   Yes the codegen is the primary benefit I'm thinking of for this. It's minor 
but if the generated stubs just produce a `bool` instead of `*bool` or 
`std::optional<bool>` and we always want unspecified to be `false`, then it 
eliminates a potential source of bugs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to