Skip to content

Commit 8294717

Browse files
committed
add error messages for unexpected situations
1 parent 8d45d49 commit 8294717

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Framework/Core/src/ArrowTableSlicingCache.cxx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ arrow::Status ArrowTableSlicingCache::updateCacheEntry(int pos, std::shared_ptr<
112112
}
113113
auto& [b,k,e] = bindingsKeys[pos];
114114
if (!e) {
115-
throw runtime_error_f("Disabled slicing cache of %s by %s update requested - this should not happen.", b.c_str(), k.c_str());
115+
throw runtime_error_f("Disabled cache %s/%s update requested", b.c_str(), k.c_str());
116116
}
117117
validateOrder(bindingsKeys[pos], table);
118118
arrow::Datum value_counts;
@@ -137,7 +137,7 @@ arrow::Status ArrowTableSlicingCache::updateCacheEntryUnsorted(int pos, const st
137137
}
138138
auto& [b, k, e] = bindingsKeysUnsorted[pos];
139139
if (!e) {
140-
throw runtime_error_f("Disabled slicing cache of %s by %s update requested - this should not happen.", b.c_str(), k.c_str());
140+
throw runtime_error_f("Disabled unsorted cache %s/%s update requested", b.c_str(), k.c_str());
141141
}
142142
auto column = table->GetColumnByName(k);
143143
auto row = 0;
@@ -197,6 +197,9 @@ SliceInfoPtr ArrowTableSlicingCache::getCacheFor(Entry const& bindingKey) const
197197
if (!s) {
198198
throw runtime_error_f("%s/%s is found in unsorted cache", bindingKey.binding.c_str(), bindingKey.key.c_str());
199199
}
200+
if(!bindingsKeys[p].enabled) {
201+
throw runtime_error_f("Disabled cache %s/%s is requested", bindingKey.binding.c_str(), bindingKey.key.c_str());
202+
}
200203

201204
return getCacheForPos(p);
202205
}
@@ -207,6 +210,9 @@ SliceInfoUnsortedPtr ArrowTableSlicingCache::getCacheUnsortedFor(const Entry& bi
207210
if (s) {
208211
throw runtime_error_f("%s/%s is found in sorted cache", bindingKey.binding.c_str(), bindingKey.key.c_str());
209212
}
213+
if(!bindingsKeys[p].enabled) {
214+
throw runtime_error_f("Disabled unsorted cache %s/%s is requested", bindingKey.binding.c_str(), bindingKey.key.c_str());
215+
}
210216

211217
return getCacheUnsortedForPos(p);
212218
}

0 commit comments

Comments
 (0)