|
25 | 25 |
|
26 | 26 | #include <nlohmann/json.hpp> |
27 | 27 |
|
| 28 | +#include "../../build/_deps/fmt-src/include/fmt/color.h" |
| 29 | +#include "iceberg/exception.h" |
28 | 30 | #include "iceberg/file_io.h" |
29 | 31 | #include "iceberg/json_internal.h" |
30 | 32 | #include "iceberg/partition_spec.h" |
@@ -228,152 +230,157 @@ std::unique_ptr<TableMetadataBuilder> TableMetadataBuilder::BuildFrom( |
228 | 230 |
|
229 | 231 | TableMetadataBuilder& TableMetadataBuilder::SetMetadataLocation( |
230 | 232 | std::string_view metadata_location) { |
231 | | - return *this; |
| 233 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
232 | 234 | } |
233 | 235 |
|
234 | 236 | TableMetadataBuilder& TableMetadataBuilder::SetPreviousMetadataLocation( |
235 | 237 | std::string_view previous_metadata_location) { |
236 | | - return *this; |
| 238 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
237 | 239 | } |
238 | 240 |
|
239 | | -TableMetadataBuilder& TableMetadataBuilder::AssignUUID() { return *this; } |
| 241 | +TableMetadataBuilder& TableMetadataBuilder::AssignUUID() { |
| 242 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
| 243 | +} |
240 | 244 |
|
241 | 245 | TableMetadataBuilder& TableMetadataBuilder::AssignUUID(std::string_view uuid) { |
242 | | - return *this; |
| 246 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
| 247 | + ; |
243 | 248 | } |
244 | 249 |
|
245 | 250 | TableMetadataBuilder& TableMetadataBuilder::UpgradeFormatVersion( |
246 | 251 | int8_t new_format_version) { |
247 | | - return *this; |
| 252 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
248 | 253 | } |
249 | 254 |
|
250 | 255 | TableMetadataBuilder& TableMetadataBuilder::SetCurrentSchema( |
251 | 256 | std::shared_ptr<Schema> schema, int32_t new_last_column_id) { |
252 | | - return *this; |
| 257 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
253 | 258 | } |
254 | 259 |
|
255 | 260 | TableMetadataBuilder& TableMetadataBuilder::SetCurrentSchema(int32_t schema_id) { |
256 | | - return *this; |
| 261 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
257 | 262 | } |
258 | 263 |
|
259 | 264 | TableMetadataBuilder& TableMetadataBuilder::AddSchema(std::shared_ptr<Schema> schema) { |
260 | | - return *this; |
| 265 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
261 | 266 | } |
262 | 267 |
|
263 | 268 | TableMetadataBuilder& TableMetadataBuilder::SetDefaultPartitionSpec( |
264 | 269 | std::shared_ptr<PartitionSpec> spec) { |
265 | | - return *this; |
| 270 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
266 | 271 | } |
267 | 272 |
|
268 | 273 | TableMetadataBuilder& TableMetadataBuilder::SetDefaultPartitionSpec(int32_t spec_id) { |
269 | | - return *this; |
| 274 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
270 | 275 | } |
271 | 276 |
|
272 | 277 | TableMetadataBuilder& TableMetadataBuilder::AddPartitionSpec( |
273 | 278 | std::shared_ptr<PartitionSpec> spec) { |
274 | | - return *this; |
| 279 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
275 | 280 | } |
276 | 281 |
|
277 | 282 | TableMetadataBuilder& TableMetadataBuilder::RemovePartitionSpecs( |
278 | 283 | const std::vector<int32_t>& spec_ids) { |
279 | | - return *this; |
| 284 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
280 | 285 | } |
281 | 286 |
|
282 | 287 | TableMetadataBuilder& TableMetadataBuilder::RemoveSchemas( |
283 | 288 | const std::vector<int32_t>& schema_ids) { |
284 | | - return *this; |
| 289 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
285 | 290 | } |
286 | 291 |
|
287 | 292 | TableMetadataBuilder& TableMetadataBuilder::SetDefaultSortOrder( |
288 | 293 | std::shared_ptr<SortOrder> order) { |
289 | | - return *this; |
| 294 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
290 | 295 | } |
291 | 296 |
|
292 | 297 | TableMetadataBuilder& TableMetadataBuilder::SetDefaultSortOrder(int32_t order_id) { |
293 | | - return *this; |
| 298 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
294 | 299 | } |
295 | 300 |
|
296 | 301 | TableMetadataBuilder& TableMetadataBuilder::AddSortOrder( |
297 | 302 | std::shared_ptr<SortOrder> order) { |
298 | | - return *this; |
| 303 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
299 | 304 | } |
300 | 305 |
|
301 | 306 | TableMetadataBuilder& TableMetadataBuilder::AddSnapshot( |
302 | 307 | std::shared_ptr<Snapshot> snapshot) { |
303 | | - return *this; |
| 308 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
304 | 309 | } |
305 | 310 |
|
306 | 311 | TableMetadataBuilder& TableMetadataBuilder::SetBranchSnapshot(int64_t snapshot_id, |
307 | 312 | const std::string& branch) { |
308 | | - return *this; |
| 313 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
309 | 314 | } |
310 | 315 |
|
311 | 316 | TableMetadataBuilder& TableMetadataBuilder::SetRef(const std::string& name, |
312 | 317 | std::shared_ptr<SnapshotRef> ref) { |
313 | | - return *this; |
| 318 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
314 | 319 | } |
315 | 320 |
|
316 | 321 | TableMetadataBuilder& TableMetadataBuilder::RemoveRef(const std::string& name) { |
317 | | - return *this; |
| 322 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
318 | 323 | } |
319 | 324 |
|
320 | 325 | TableMetadataBuilder& TableMetadataBuilder::RemoveSnapshots( |
321 | 326 | const std::vector<std::shared_ptr<Snapshot>>& snapshots_to_remove) { |
322 | | - return *this; |
| 327 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
323 | 328 | } |
324 | 329 |
|
325 | 330 | TableMetadataBuilder& TableMetadataBuilder::RemoveSnapshots( |
326 | 331 | const std::vector<int64_t>& snapshot_ids) { |
327 | | - return *this; |
| 332 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
328 | 333 | } |
329 | 334 |
|
330 | 335 | TableMetadataBuilder& TableMetadataBuilder::suppressHistoricalSnapshots() { |
331 | | - return *this; |
| 336 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
332 | 337 | } |
333 | 338 |
|
334 | 339 | TableMetadataBuilder& TableMetadataBuilder::SetStatistics( |
335 | 340 | const std::shared_ptr<StatisticsFile>& statistics_file) { |
336 | | - return *this; |
| 341 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
337 | 342 | } |
338 | 343 |
|
339 | 344 | TableMetadataBuilder& TableMetadataBuilder::RemoveStatistics(int64_t snapshot_id) { |
340 | | - return *this; |
| 345 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
341 | 346 | } |
342 | 347 |
|
343 | 348 | TableMetadataBuilder& TableMetadataBuilder::SetPartitionStatistics( |
344 | 349 | const std::shared_ptr<PartitionStatisticsFile>& partition_statistics_file) { |
345 | | - return *this; |
| 350 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
346 | 351 | } |
347 | 352 |
|
348 | 353 | TableMetadataBuilder& TableMetadataBuilder::RemovePartitionStatistics( |
349 | 354 | int64_t snapshot_id) { |
350 | | - return *this; |
| 355 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
351 | 356 | } |
352 | 357 |
|
353 | 358 | TableMetadataBuilder& TableMetadataBuilder::SetProperties( |
354 | 359 | const std::unordered_map<std::string, std::string>& updated) { |
355 | | - return *this; |
| 360 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
356 | 361 | } |
357 | 362 |
|
358 | 363 | TableMetadataBuilder& TableMetadataBuilder::RemoveProperties( |
359 | 364 | const std::vector<std::string>& removed) { |
360 | | - return *this; |
| 365 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
361 | 366 | } |
362 | 367 |
|
363 | 368 | TableMetadataBuilder& TableMetadataBuilder::SetLocation(std::string_view location) { |
364 | | - return *this; |
| 369 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
365 | 370 | } |
366 | 371 |
|
367 | 372 | TableMetadataBuilder& TableMetadataBuilder::AddEncryptionKey( |
368 | 373 | std::shared_ptr<EncryptedKey> key) { |
369 | | - return *this; |
| 374 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
370 | 375 | } |
371 | 376 |
|
372 | 377 | TableMetadataBuilder& TableMetadataBuilder::RemoveEncryptionKey(std::string_view key_id) { |
373 | | - return *this; |
| 378 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
374 | 379 | } |
375 | 380 |
|
376 | | -TableMetadataBuilder& TableMetadataBuilder::DiscardChanges() { return *this; } |
| 381 | +TableMetadataBuilder& TableMetadataBuilder::DiscardChanges() { |
| 382 | + throw IcebergError(std::format("{} not implemented", __FUNCTION__)); |
| 383 | +} |
377 | 384 |
|
378 | 385 | Result<std::unique_ptr<TableMetadata>> TableMetadataBuilder::Build() { |
379 | 386 | return NotImplemented("TableMetadataBuilder::Build not implemented"); |
|
0 commit comments