• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Giorgi / DuckDB.NET / 35471425363

19 Sep 2026 09:46PM UTC coverage: 88.269% (-1.1%) from 89.361%
35471425363

push

github

Giorgi
Drop the enable_http_logging grouping case

DuckDB main no longer has the enable_http_logging setting, so the
connection string builder does not expose it and the lookup returned
null. No remaining option combines the http and logging segments, so
the case has no replacement here. develop keeps it while it targets
v1.5.5.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQt5x6WgR3rH3Zsd1guVT

1587 of 1885 branches covered (84.19%)

Branch coverage included in aggregate %.

3161 of 3494 relevant lines covered (90.47%)

375857.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/DuckDB.NET.Data/DataChunk/Reader/MapVectorDataReader.cs
1
namespace DuckDB.NET.Data.DataChunk.Reader;
2

3
internal sealed class MapVectorDataReader : VectorDataReaderBase
4
{
5
    private readonly VectorDataReaderBase keyReader;
6
    private readonly VectorDataReaderBase valueReader;
7

8
    internal unsafe MapVectorDataReader(IntPtr vector, void* dataPointer, ulong* validityMaskPointer, DuckDBType columnType, DuckDBLogicalType logicalColumnType, string columnName) 
9
                    : base(dataPointer, validityMaskPointer, columnType, columnName)
198 ✔
10
    {
11
        using var keyTypeLogical = NativeMethods.LogicalType.DuckDBMapTypeKeyType(logicalColumnType);
198 ✔
12
        using var valueTypeLogical = NativeMethods.LogicalType.DuckDBMapTypeValueType(logicalColumnType);
198 ✔
13

14
        var childVector = NativeMethods.Vectors.DuckDBListVectorGetChild(vector);
198 ✔
15

16
        var keyVector = NativeMethods.Vectors.DuckDBStructVectorGetChild(childVector, 0);
198 ✔
17
        var valueVector = NativeMethods.Vectors.DuckDBStructVectorGetChild(childVector, 1);
198 ✔
18

19
        keyReader = VectorDataReaderFactory.CreateReader(keyVector, keyTypeLogical, columnName);
198 ✔
20
        valueReader = VectorDataReaderFactory.CreateReader(valueVector, valueTypeLogical, columnName);
198 ✔
21
    }
396 ✔
22

23
    protected override Type GetColumnType()
24
    {
25
        return typeof(Dictionary<,>).MakeGenericType(keyReader.ClrType, valueReader.ClrType);
21 ✔
26
    }
27

28
    protected override Type GetColumnProviderSpecificType()
29
    {
30
        return typeof(Dictionary<,>).MakeGenericType(keyReader.ProviderSpecificClrType, valueReader.ProviderSpecificClrType);
6 ✔
31
    }
32

33
    internal override unsafe object GetValue(ulong offset, Type targetType)
34
    {
35
        if (DuckDBType != DuckDBType.Map)
60 !
36
        {
37
            return base.GetValue(offset, targetType);
×
38
        }
39

40
        if (Activator.CreateInstance(targetType) is not IDictionary instance)
60 ✔
41
        {
42
            throw new InvalidOperationException($"Cannot read Map column {ColumnName} in a non-dictionary type");
3 ✔
43
        }
44

45
        var arguments = targetType.GetGenericArguments();
57 ✔
46

47
        var keyTargetType = keyReader.ClrType;
57 ✔
48
        var valueTargetType = valueReader.ClrType;
57 ✔
49
        var allowsNullValues = false;
57 ✔
50

51
        if (arguments.Length == 2)
57 ✔
52
        {
53
            if (arguments[0] == typeof(object) || arguments[1] == typeof(object))
57 ✔
54
            {
55
                throw new InvalidCastException($"Cannot read Map column {ColumnName} as a dictionary with object keys or values. Use a dictionary with concrete key and value types, or GetValue().");
6 ✔
56
            }
57

58
            arguments[0].AllowsNullValue(out _, out var underlyingKeyType);
51 ✔
59
            keyTargetType = underlyingKeyType ?? arguments[0];
51 ✔
60

61
            allowsNullValues = arguments[1].AllowsNullValue(out _, out var underlyingValueType);
51 ✔
62
            valueTargetType = underlyingValueType ?? arguments[1];
51 ✔
63
        }
64

65
        var listData = (DuckDBListEntry*)DataPointer + offset;
51 ✔
66

67
        for (ulong i = 0; i < listData->Length; i++)
288 ✔
68
        {
69
            var childOffset = i + listData->Offset;
96 ✔
70

71
            var key = keyReader.IsValid(childOffset) ? keyReader.GetValue(childOffset, keyTargetType) : null!;
96 !
72
            var value = valueReader.IsValid(childOffset) ? valueReader.GetValue(childOffset, valueTargetType) : null;
96 ✔
73

74
            if (allowsNullValues || value != null)
96 ✔
75
            {
76
                instance.Add(key, value);
93 ✔
77
            }
78
            else
79
            {
80
                throw new InvalidCastException($"The Map in column {ColumnName} contains null value but dictionary does not allow null values");
3 ✔
81
            }
82
        }
83

84
        return instance;
48 ✔
85
    }
86

87
    internal override void Reset(IntPtr vector)
88
    {
89
        base.Reset(vector);
×
90
        var childVector = NativeMethods.Vectors.DuckDBListVectorGetChild(vector);
×
91
        var keyVector = NativeMethods.Vectors.DuckDBStructVectorGetChild(childVector, 0);
×
92
        var valueVector = NativeMethods.Vectors.DuckDBStructVectorGetChild(childVector, 1);
×
93
        keyReader.Reset(keyVector);
×
94
        valueReader.Reset(valueVector);
×
95
    }
×
96

97
    public override void Dispose()
98
    {
99
        keyReader.Dispose();
9 ✔
100
        valueReader.Dispose();
9 ✔
101
        base.Dispose();
9 ✔
102
    }
9 ✔
103
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc