lidavidm commented on code in PR #38385:
URL: https://github.com/apache/arrow/pull/38385#discussion_r1391106859
##########
format/FlightSql.proto:
##########
@@ -1779,9 +1796,61 @@ message CommandPreparedStatementUpdate {
}
/*
- * Returned from the RPC call DoPut when a CommandStatementUpdate
- * CommandPreparedStatementUpdate was in the request, containing
- * results from the update.
+ * Represents a bulk ingestion request. Used in the command member of
FlightDescriptor
+ * for the the RPC call DoPut to cause the server load the contents of the
stream's
+ * FlightData into the target destination.
+ */
+message CommandStatementIngest {
+ option (experimental) = true;
+
+ // Describes the behavior for loading bulk data.
+ enum IngestMode {
+ // Ingestion behavior unspecified.
+ INGEST_MODE_UNSPECIFIED = 0;
+ // Create the target table. Fail if the target table already exists.
+ INGEST_MODE_CREATE = 1;
+ // Append to an existing target table. Fail if the target table does not
exist.
+ INGEST_MODE_APPEND = 2;
+ // Drop the target table if it exists. Then follow INGEST_MODE_CREATE
behavior.
+ INGEST_MODE_REPLACE = 3;
+ // Create the target table if it does not exist. Then follow
INGEST_MODE_APPEND behavior.
+ INGEST_MODE_CREATE_APPEND = 4;
+ }
+
+ // The ingestion behavior.
+ IngestMode mode = 1;
+ // The table to load data into.
+ string table = 2;
+ // The db_schema of the destination table to load data into. If unset, a
backend-specific default may be used.
+ optional string schema = 3;
+ // The catalog of the destination table to load data into. If unset, a
backend-specific default may be used.
+ optional string catalog = 4;
+ /*
+ * Store ingested data in a temporary table.
+ * With the exception of INGEST_MODE_APPEND, leaving temporary unspecified
is equivalent to temporary=false.
+ * The effect of setting temporary depends on the choice of IngestMode:
+ * - INGEST_MODE_CREATE: Create a temp table. Fail if it already exists.
+ * - INGEST_MODE_APPEND: Add the following validations to the existing
INGEST_MODE_APPEND behavior:
+ * - temporary=true - Use temporary target table with the given name,
error if none exists
+ * - temporary=false - Use non-temporary target table with the given
name, error if none exists
+ * - unspecified - If both temporary and non-temporary tables exist
with the target table name, the temporary table has priority.
+ * - INGEST_MODE_REPLACE: Drop the table if it exists. Then follow
INGEST_MODE_CREATE behavior. Fail if the target is not a temp table.
Review Comment:
I would expect this to drop a temporary table if it exists, otherwise ignore
any other tables that may have the same name (again: since a temporary table is
otherwise just a table in a particular namespace)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]