|
22 | 22 | import com.alibaba.fluss.metadata.PartitionInfo; |
23 | 23 | import com.alibaba.fluss.metadata.Schema; |
24 | 24 | import com.alibaba.fluss.metadata.TableDescriptor; |
| 25 | +import com.alibaba.fluss.metadata.TableInfo; |
25 | 26 | import com.alibaba.fluss.metadata.TablePath; |
26 | 27 | import com.alibaba.fluss.row.BinaryString; |
27 | 28 | import com.alibaba.fluss.row.InternalRow; |
|
33 | 34 | import com.alibaba.fluss.types.BytesType; |
34 | 35 | import com.alibaba.fluss.types.CharType; |
35 | 36 | import com.alibaba.fluss.types.DataTypeRoot; |
| 37 | +import com.alibaba.fluss.types.DataTypes; |
36 | 38 | import com.alibaba.fluss.types.DateType; |
37 | 39 | import com.alibaba.fluss.types.DoubleType; |
38 | 40 | import com.alibaba.fluss.types.FloatType; |
@@ -154,7 +156,33 @@ class NewPartitionedTableITCase extends ClientToServerITCaseBase { |
154 | 156 | "2025-05-31-03-42-35_428"); |
155 | 157 |
|
156 | 158 | @Test |
157 | | - void testMultipleTypedPartitionedTable() throws Exception { |
| 159 | + public void testPartitionedTable() throws Exception { |
| 160 | + TablePath tablePath = TablePath.of("fluss", "person"); |
| 161 | + |
| 162 | + TableDescriptor partitionedTable = |
| 163 | + TableDescriptor.builder() |
| 164 | + .schema( |
| 165 | + Schema.newBuilder() |
| 166 | + .column("id", DataTypes.INT()) |
| 167 | + .column("name", DataTypes.STRING()) |
| 168 | + .column("dt", DataTypes.DATE()) |
| 169 | + .build()) |
| 170 | + .distributedBy(3, "name") |
| 171 | + .partitionedBy("id", "dt") |
| 172 | + .build(); |
| 173 | + admin.createTable(tablePath, partitionedTable, true).get(); |
| 174 | + TableInfo tableInfo = admin.getTableInfo(tablePath).get(); |
| 175 | + |
| 176 | + assertThat(tableInfo).isNotNull(); |
| 177 | + assertThat(tableInfo.getTablePath()).isEqualTo(tablePath); |
| 178 | + |
| 179 | + List<String> partitionKeys = tableInfo.getPartitionKeys(); |
| 180 | + assertThat(partitionKeys).hasSize(2); |
| 181 | + assertThat(partitionKeys).containsExactly("id", "dt"); |
| 182 | + } |
| 183 | + |
| 184 | + @Test |
| 185 | + public void testMultipleTypedPartitionedTable() throws Exception { |
158 | 186 |
|
159 | 187 | for (int i = 0; i < allPartitionKeyTypes.length; i++) { |
160 | 188 | String partitionKey = extraColumn[i].getName(); |
|
0 commit comments