Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-15051

[C#] Not nullable field can have null values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Minor
    • Resolution: Unresolved
    • 6.0.1
    • None
    • C#
    • None

    Description

      When the record batch schema field's parameter of nullable is set to false, it supposes to make the field not null, however, it can still have null values.

       

      Code to reproduce:

                  var memoryAllocator = new NativeMemoryAllocator(alignment: 64);
                  var stream1 = File.OpenWrite(@"c:\temp\data\test.arrow");
                  
                  Schema schema = new Schema
                  (new List<Field>
                 

      {                 new Field("Column A", StringType.Default, false)             }

      ,
                  default
                  );

                  List<string> rows = new List<string>();
                  rows.Add("11");
                  rows.Add("22");
                  rows.Add(null);

                  ArrowFileWriter writer = new ArrowFileWriter(stream1, schema);

                  var recordBatch1 = new RecordBatch.Builder(memoryAllocator)
                      .Append("Column A", false, col => col.String(array => array.AppendRange(rows)))
                      .Build();
                  writer.WriteRecordBatch(recordBatch1);
                  writer.WriteEnd();
                  stream1.Close();

      Attachments

        Activity

          People

            Unassigned Unassigned
            Zixi Zixi Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: