-- | It receives an RTable and a default value. It returns a new RTable which is identical to the source one
-- but for each RTuple, for the specified column every Null value in every RTuple has been replaced by a default value
-- If you pass an empty RTable, then it returns an empty RTable
-- Calls error if the column does not exist
nvlRTable ::
        ColumnName  -- ^ ColumnName key
    ->  RDataType -- ^ Default value        
    ->  RTable    -- ^ input RTable
    ->  RTable
nvlRTable c defaultVal tab  = 
    if isRTabEmpty tab
        then emptyRTable
        else
            V.map (\t -> upsertRTuple c (nvlColValue c defaultVal t) t) tab
nvlRTable ::
        ColumnName  -- ^ ColumnName key
    ->  RDataType -- ^ Default value        
    ->  RTable    -- ^ input RTable
    ->  RTable
nvlRTable c defaultVal tab  = 
    if isRTabEmpty tab
        then emptyRTable
        else
            V.map (\t -> upsertRTuple c (nvlColValue c defaultVal t) t) tab
nvlRTable c defaultVal tab  = 
    if isRTabEmpty tab
        then emptyRTable
        else
            V.map (\t -> upsertRTuple c (nvlColValue c defaultVal t) t) tab