|
1 | 1 | package com.scalar.db.dataloader.core.util; |
2 | 2 |
|
3 | | -import com.scalar.db.api.TableMetadata; |
4 | 3 | import com.scalar.db.dataloader.core.Constants; |
5 | 4 | import com.scalar.db.dataloader.core.dataimport.controlfile.ControlFileTable; |
6 | | -import com.scalar.db.transaction.consensuscommit.Attribute; |
7 | | -import com.scalar.db.transaction.consensuscommit.ConsensusCommitUtils; |
8 | | -import java.util.ArrayList; |
9 | | -import java.util.List; |
10 | 5 | import lombok.AccessLevel; |
11 | 6 | import lombok.NoArgsConstructor; |
12 | 7 |
|
@@ -38,37 +33,4 @@ public static String getTableLookupKey(ControlFileTable controlFileTable) { |
38 | 33 | controlFileTable.getNamespace(), |
39 | 34 | controlFileTable.getTable()); |
40 | 35 | } |
41 | | - |
42 | | - /** |
43 | | - * Adds metadata columns to a list of projection columns for a ScalarDB table. |
44 | | - * |
45 | | - * @param tableMetadata The metadata of the ScalarDB table. |
46 | | - * @param projections A list of projection column names. |
47 | | - * @return A new list containing projection columns along with metadata columns. |
48 | | - */ |
49 | | - public static List<String> populateProjectionsWithMetadata( |
50 | | - TableMetadata tableMetadata, List<String> projections) { |
51 | | - List<String> projectionMetadata = new ArrayList<>(); |
52 | | - projections.forEach( |
53 | | - projection -> { |
54 | | - projectionMetadata.add(projection); |
55 | | - if (!isKeyColumn(projection, tableMetadata)) { |
56 | | - projectionMetadata.add(Attribute.BEFORE_PREFIX + projection); |
57 | | - } |
58 | | - }); |
59 | | - projectionMetadata.addAll(ConsensusCommitUtils.getTransactionMetaColumns().keySet()); |
60 | | - return projectionMetadata; |
61 | | - } |
62 | | - |
63 | | - /** |
64 | | - * Checks whether a column is a key column (partition key or clustering key) in the table. |
65 | | - * |
66 | | - * @param column The name of the column to check. |
67 | | - * @param tableMetadata The metadata of the ScalarDB table. |
68 | | - * @return {@code true} if the column is a key column; {@code false} otherwise. |
69 | | - */ |
70 | | - private static boolean isKeyColumn(String column, TableMetadata tableMetadata) { |
71 | | - return tableMetadata.getPartitionKeyNames().contains(column) |
72 | | - || tableMetadata.getClusteringKeyNames().contains(column); |
73 | | - } |
74 | 36 | } |
0 commit comments