|
| 1 | +/* |
| 2 | + * Copyright (c) Meta Platforms, Inc. and its affiliates. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +#pragma once |
| 17 | + |
| 18 | +#include "axiom/common/Enums.h" |
| 19 | + |
| 20 | +namespace facebook::axiom { |
| 21 | + |
| 22 | +/// Specifies what type of write is intended when initiating or concluding a |
| 23 | +/// write operation. |
| 24 | +enum class WriteKind { |
| 25 | + /// A write operation to a new table which does not yet exist in the |
| 26 | + /// connector. Covers both creation of an empty table and create as select |
| 27 | + /// operations. |
| 28 | + kCreate = 1, |
| 29 | + |
| 30 | + /// Rows are added and all columns must be specified for the TableWriter. |
| 31 | + /// Covers insert, Hive partition replacement or any other operation which |
| 32 | + /// adds whole rows. |
| 33 | + kInsert = 2, |
| 34 | + |
| 35 | + /// Individual rows are deleted. Only row ids as per |
| 36 | + /// ConnectorMetadata::rowIdHandles() are passed to the TableWriter. |
| 37 | + kDelete = 3, |
| 38 | + |
| 39 | + /// Column values in individual rows are changed. The TableWriter |
| 40 | + /// gets first the row ids as per ConnectorMetadata::rowIdHandles() |
| 41 | + /// and then new values for the columns being changed. The new values |
| 42 | + /// may overlap with row ids if the row id is a set of primary key |
| 43 | + /// columns. |
| 44 | + kUpdate = 4, |
| 45 | +}; |
| 46 | + |
| 47 | +AXIOM_DECLARE_ENUM_NAME(WriteKind); |
| 48 | + |
| 49 | +} // namespace facebook::axiom |
| 50 | + |
| 51 | +AXIOM_ENUM_FORMATTER(facebook::axiom::WriteKind); |
0 commit comments