Skip to content

Commit

Permalink
fix supported field check
Browse files Browse the repository at this point in the history
  • Loading branch information
mukunku committed Mar 6, 2024
1 parent 51387ff commit bd8cccf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ParquetViewer/FieldSelectionDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,11 @@ private void ClearAndDisposeCheckboxes()
public static bool IsSupportedFieldType(Field field) =>
field.SchemaType switch
{
SchemaType.List when field is ListField lf && lf.Item.SchemaType != SchemaType.List => true, //we don't support nested lists
_ => true
SchemaType.Data => true,
SchemaType.List when field is ListField lf && lf.Item.SchemaType == SchemaType.Data => true,
SchemaType.Map when field is MapField mp && mp.Key.SchemaType == SchemaType.Data && mp.Value.SchemaType == SchemaType.Data => true,
SchemaType.Struct when field is StructField sf => sf.Fields.All(IsSupportedFieldType),
_ => false
};

private void allFieldsRadioButton_CheckedChanged(object sender, EventArgs e)
Expand Down

0 comments on commit bd8cccf

Please sign in to comment.