@@ -64,7 +64,7 @@ unique_ptr<SnapshotParseInfo> IcebergSnapshot::GetParseInfo(yyjson_doc &metadata
64
64
} else {
65
65
auto schema = yyjson_obj_get (root, " schema" );
66
66
if (!schema) {
67
- throw IOException (" Neither a valid schema or schemas field was found" );
67
+ throw InvalidInputException (" Neither a valid schema or schemas field was found" );
68
68
}
69
69
auto found_schema_id = IcebergUtils::TryGetNumFromObject (schema, " schema-id" );
70
70
info.schemas .push_back (schema);
@@ -103,7 +103,7 @@ IcebergSnapshot IcebergSnapshot::GetSnapshotById(const string &path, FileSystem
103
103
auto snapshot = FindSnapshotByIdInternal (info->snapshots , snapshot_id);
104
104
105
105
if (!snapshot) {
106
- throw IOException (" Could not find snapshot with id " + to_string (snapshot_id));
106
+ throw InvalidInputException (" Could not find snapshot with id " + to_string (snapshot_id));
107
107
}
108
108
109
109
return ParseSnapShot (snapshot, info->iceberg_version , info->schema_id , info->schemas , options);
@@ -115,7 +115,7 @@ IcebergSnapshot IcebergSnapshot::GetSnapshotByTimestamp(const string &path, File
115
115
auto snapshot = FindSnapshotByIdTimestampInternal (info->snapshots , timestamp);
116
116
117
117
if (!snapshot) {
118
- throw IOException (" Could not find latest snapshots for timestamp " + Timestamp::ToString (timestamp));
118
+ throw InvalidInputException (" Could not find latest snapshots for timestamp " + Timestamp::ToString (timestamp));
119
119
}
120
120
121
121
return ParseSnapShot (snapshot, info->iceberg_version , info->schema_id , info->schemas , options);
@@ -138,7 +138,7 @@ static string GenerateMetaDataUrl(FileSystem &fs, const string &meta_path, strin
138
138
}
139
139
}
140
140
141
- throw IOException (
141
+ throw InvalidInputException (
142
142
" Iceberg metadata file not found for table version '%s' using '%s' compression and format(s): '%s'" ,
143
143
table_version, options.metadata_compression_codec , options.version_name_format );
144
144
}
@@ -171,7 +171,7 @@ string IcebergSnapshot::GetMetaDataPath(ClientContext &context, const string &pa
171
171
}
172
172
if (!UnsafeVersionGuessingEnabled (context)) {
173
173
// Make sure we're allowed to guess versions
174
- throw IOException (
174
+ throw InvalidInputException (
175
175
" Failed to read iceberg table. No version was provided and no version-hint could be found, globbing the "
176
176
" filesystem to locate the latest version is disabled by default as this is considered unsafe and could "
177
177
" result in reading uncommitted data. To enable this use 'SET %s = true;'" ,
@@ -195,7 +195,7 @@ IcebergSnapshot IcebergSnapshot::ParseSnapShot(yyjson_val *snapshot, idx_t icebe
195
195
if (snapshot) {
196
196
auto snapshot_tag = yyjson_get_type (snapshot);
197
197
if (snapshot_tag != YYJSON_TYPE_OBJ) {
198
- throw IOException (" Invalid snapshot field found parsing iceberg metadata.json" );
198
+ throw InvalidInputException (" Invalid snapshot field found parsing iceberg metadata.json" );
199
199
}
200
200
ret.metadata_compression_codec = options.metadata_compression_codec ;
201
201
if (iceberg_format_version == 1 ) {
@@ -226,9 +226,9 @@ string IcebergSnapshot::GetTableVersionFromHint(const string &meta_path, FileSys
226
226
try {
227
227
return version_file_content;
228
228
} catch (std::invalid_argument &e) {
229
- throw IOException (" Iceberg version hint file contains invalid value" );
229
+ throw InvalidInputException (" Iceberg version hint file contains invalid value" );
230
230
} catch (std::out_of_range &e) {
231
- throw IOException (" Iceberg version hint file contains invalid value" );
231
+ throw InvalidInputException (" Iceberg version hint file contains invalid value" );
232
232
}
233
233
}
234
234
@@ -262,8 +262,8 @@ string IcebergSnapshot::GuessTableVersion(const string &meta_path, FileSystem &f
262
262
}
263
263
}
264
264
265
- throw IOException (" Could not guess Iceberg table version using '%s' compression and format(s): '%s'" ,
266
- metadata_compression_codec, version_format);
265
+ throw InvalidInputException (" Could not guess Iceberg table version using '%s' compression and format(s): '%s'" ,
266
+ metadata_compression_codec, version_format);
267
267
}
268
268
269
269
string IcebergSnapshot::PickTableVersion (vector<string> &found_metadata, string &version_pattern, string &glob) {
0 commit comments