You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using joined RDFs: FilterAvailable error on defined column that uses an aliased column and FilterAvailable error on an aliased column. #22759
After using RDataFrame Alias on a coulmn and then Define a new column using this aliased column, if one uses FilterAvailable on either the aliased column or the new defined column errors appear.
For TTree case:
FilterAvailable on the DEFINED column: RDataFrame: Define could not retrieve value for column 'met_met_NOSYS' for entry 1. You can use the DefaultValueFor operation to provide a default value, or FilterAvailable/FilterMissing to discard/keep entries with missing values instead.
FilterAvailable on the Alias column:
The resulting RDF reports 0 entries.
For the RNTuple case:
FilterAvailable on the DEFINED column: RDataFrame: Define could not retrieve value for column 'reco.met_met_NOSYS' for entry 1. You can use the DefaultValueFor operation to provide a default value, or FilterAvailable/FilterMissing to discard/keep entries with missing values instead.
FilterAvailable on the Alias column: RNTupleProcessorDS: Column "matched_field" does not exist
Reproducer
Here I attach the reproducer. To see the different errors I just uncomment the section I want to test.
I also attach the root files required for testing.
For the ttree part the root versions used to find the same errors were:
ROOT Version: 6.40.00
Built for linuxx8664gcc on May 26 2026, 15:56:51
From tags/v6-40-00@v6-40-00
ROOT Version: 6.41.01
Built for linuxx8664gcc on Jun 15 2026, 08:27:46
From heads/ntuple-ds-processor@v6-39-99-585-g56d04c01
For the RNTuple part the root version used was:
ROOT Version: 6.41.01
Built for linuxx8664gcc on Jun 15 2026, 08:27:46
From heads/ntuple-ds-processor@v6-39-99-585-g56d04c01
Hello, @vepadulano! I'm Moazzam Shahzad, and I'm new here.
For the TTree case, let's focus on what happens when the following line is executed: auto kept2 = base.FilterAvailable("matched_field").Count();
When .Count() is executed, the lazy graph evaluation starts. We know RFilterWithMissingValues::InitSlot() calls RColumnRegister::GetReaderUnchecked(), which checks if a column is a variation or a Define. However, this function does not check if a column is an alias or not, and so it returns nullptr. This nullptr propagates upwards; it prevents reading the original column's values when the columns are later fetched for calculation, and thus, the system reports 0 entries, as found in the reproducer code. Besides RColumnRegister::GetReaderUnchecked(), I also found the same problem (no alias check) in RColumnRegister::GetReader(). Thus, the fix appears to be to add a simple check to see if a column is an alias or not (and resolve it if it is) inside RColumnRegister::GetReader() and RColumnRegister::GetReaderUnchecked().
For the RNTuple case, that is a separate branch that is actively being worked on, and it's your choice whether you want me to work on that fix or if the currently active developer should fix it.
If my diagnosis for the TTree case seems reasonable to you, please allow me to start work on the fix, and let me know how you want to proceed with the RNTuple case. Thank you.
Thanks for taking interest in the ROOT project and in this issue!
You are hitting certain things right with your description above, although I believe by reading it that there are some things which are not clear yet. Feel free to work on this and propose a PR, which at the very least should include the fix for TTree and a few unit tests. I don't think for RNTuple we currently have a way to expose the case of missing entries.
FilterAvailable() on a Define column that has inputs with missing entries results in an exception instead of being filtered out. The problem is that FilterAvailable() on a Define triggers RFilterWithMissingValues::CheckFilters(), which calls RColumnReaderBase::TryGet(), which is supposed to return the evaluated value from the column. TryGet() calls RDefineReader::GetImpl(), which always runs Update() before returning fValuePtr. fValuePtr points to the Define's value storage and is never null, and GetValueChecked() (called from UpdateHelper) throws if an input is missing. So GetImpl() either returns a valid pointer or throws, and the == nullptr check in CheckFilters() can't work for Defines.
I'd like RDefine to check, in a new function called from Update(), whether its inputs are available for the entry. If one isn't, GetImpl() returns nullptr instead of evaluating. The alternative is an availability method on the reader interface called from CheckFilters(). Either way, each input gets a second TryGet() call per entry. Which would you prefer?
Activity
vepadulano commentedon Jul 6, 2026
Dear @modregominguez,
Thank you for the report and the concise reproducer! This indeed looks like a bug, I will take a look at it.
MSK-005 commentedon Oct 4, 2026
Hello, @vepadulano! I'm Moazzam Shahzad, and I'm new here.
For the
TTreecase, let's focus on what happens when the following line is executed:auto kept2 = base.FilterAvailable("matched_field").Count();When
.Count()is executed, the lazy graph evaluation starts. We knowRFilterWithMissingValues::InitSlot()callsRColumnRegister::GetReaderUnchecked(), which checks if a column is a variation or aDefine. However, this function does not check if a column is an alias or not, and so it returnsnullptr. Thisnullptrpropagates upwards; it prevents reading the original column's values when the columns are later fetched for calculation, and thus, the system reports 0 entries, as found in the reproducer code. BesidesRColumnRegister::GetReaderUnchecked(), I also found the same problem (no alias check) inRColumnRegister::GetReader(). Thus, the fix appears to be to add a simple check to see if a column is an alias or not (and resolve it if it is) insideRColumnRegister::GetReader()andRColumnRegister::GetReaderUnchecked().For the
RNTuplecase, that is a separate branch that is actively being worked on, and it's your choice whether you want me to work on that fix or if the currently active developer should fix it.If my diagnosis for the
TTreecase seems reasonable to you, please allow me to start work on the fix, and let me know how you want to proceed with theRNTuplecase. Thank you.vepadulano commentedon Oct 6, 2026
Dear @MSK-005 ,
Thanks for taking interest in the ROOT project and in this issue!
You are hitting certain things right with your description above, although I believe by reading it that there are some things which are not clear yet. Feel free to work on this and propose a PR, which at the very least should include the fix for TTree and a few unit tests. I don't think for RNTuple we currently have a way to expose the case of missing entries.
MSK-005 commentedon Oct 13, 2026
Dear @vepadulano,
I need your input for the
Definebug.FilterAvailable()on aDefinecolumn that has inputs with missing entries results in an exception instead of being filtered out. The problem is thatFilterAvailable()on aDefinetriggersRFilterWithMissingValues::CheckFilters(), which callsRColumnReaderBase::TryGet(), which is supposed to return the evaluated value from the column.TryGet()callsRDefineReader::GetImpl(), which always runsUpdate()before returningfValuePtr.fValuePtrpoints to the Define's value storage and is never null, andGetValueChecked()(called fromUpdateHelper) throws if an input is missing. SoGetImpl()either returns a valid pointer or throws, and the== nullptrcheck inCheckFilters()can't work for Defines.I'd like
RDefineto check, in a new function called fromUpdate(), whether its inputs are available for the entry. If one isn't,GetImpl()returnsnullptrinstead of evaluating. The alternative is an availability method on the reader interface called fromCheckFilters(). Either way, each input gets a secondTryGet()call per entry. Which would you prefer?