1515// specific language governing permissions and limitations 
1616// under the License. 
1717
18- use  crate :: arrow:: datatypes:: { DataType ,  IntervalUnit ,  Schema ,  TimeUnit } ; 
18+ use  crate :: arrow:: datatypes:: { DataType ,  IntervalUnit ,  Schema ,  TimeUnit ,   UnionMode } ; 
1919use  crate :: error:: { DataFusionError ,  Result } ; 
2020use  arrow:: datatypes:: Field ; 
2121use  avro_rs:: schema:: Name ; 
@@ -103,7 +103,7 @@ fn schema_to_field_with_props(
103103                    . iter ( ) 
104104                    . map ( |s| schema_to_field_with_props ( s,  None ,  has_nullable,  None ) ) 
105105                    . collect :: < Result < Vec < Field > > > ( ) ?; 
106-                 DataType :: Union ( fields) 
106+                 DataType :: Union ( fields,   UnionMode :: Dense ) 
107107            } 
108108        } 
109109        AvroSchema :: Record  {  name,  fields,  .. }  => { 
@@ -201,6 +201,7 @@ fn default_field_name(dt: &DataType) -> &str {
201201        DataType :: Interval ( unit)  => match  unit { 
202202            IntervalUnit :: YearMonth  => "intervalyear" , 
203203            IntervalUnit :: DayTime  => "intervalmonth" , 
204+             IntervalUnit :: MonthDayNano  => "intervalmonthdaynano" , 
204205        } , 
205206        DataType :: Binary  => "varbinary" , 
206207        DataType :: FixedSizeBinary ( _)  => "fixedsizebinary" , 
@@ -211,7 +212,7 @@ fn default_field_name(dt: &DataType) -> &str {
211212        DataType :: FixedSizeList ( _,  _)  => "fixed_size_list" , 
212213        DataType :: LargeList ( _)  => "largelist" , 
213214        DataType :: Struct ( _)  => "struct" , 
214-         DataType :: Union ( _)  => "union" , 
215+         DataType :: Union ( _,  _ )  => "union" , 
215216        DataType :: Dictionary ( _,  _)  => "map" , 
216217        DataType :: Map ( _,  _)  => unimplemented ! ( "Map support not implemented" ) , 
217218        DataType :: Decimal ( _,  _)  => "decimal" , 
0 commit comments