@@ -770,7 +770,7 @@ auto makeEmptyTable()
770770
771771// / Expression-based column generator to materialize columns
772772template <typename ... C>
773- auto spawner (framework::pack<C...> columns, arrow::Table* atable)
773+ auto spawner (framework::pack<C...> columns, arrow::Table* atable, const char * name )
774774{
775775 static auto new_schema = o2::soa::createSchemaFromColumns (columns);
776776 static auto projectors = framework::expressions::createProjectors (columns, atable->schema ());
@@ -788,15 +788,20 @@ auto spawner(framework::pack<C...> columns, arrow::Table* atable)
788788 while (true ) {
789789 auto s = reader.ReadNext (&batch);
790790 if (!s.ok ()) {
791- throw runtime_error_f (" Cannot read batches from table: %s" , s.ToString ().c_str ());
791+ throw runtime_error_f (" Cannot read batches from table %s : %s" , name , s.ToString ().c_str ());
792792 }
793793 if (batch == nullptr ) {
794794 break ;
795795 }
796- s = projectors->Evaluate (*batch, arrow::default_memory_pool (), &v);
797- if (!s.ok ()) {
798- throw runtime_error_f (" Cannot apply projector: %s" , s.ToString ().c_str ());
796+ try {
797+ s = projectors->Evaluate (*batch, arrow::default_memory_pool (), &v);
798+ if (!s.ok ()) {
799+ throw runtime_error_f (" Cannot apply projector to table %s: %s" , name, s.ToString ().c_str ());
800+ }
801+ } catch (std::exception& e) {
802+ throw runtime_error_f (" Cannot apply projector to table %s: exception caught: %s" , name, e.what ());
799803 }
804+
800805 for (auto i = 0u ; i < sizeof ...(C); ++i) {
801806 chunks[i].emplace_back (v.at (i));
802807 }
0 commit comments