Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Mismatch error during delta sharing sourced table

Hi, 

We are using databricks and within it the delta sharing connector, for some reason we are receiving errors when we are querying two tables, this is one of the tables query in advanced editor and I don't understand why we get the error message. 

let
Source = dim_delay_category,
  #"Detected Type Mismatches" = let
    tableWithOnlyPrimitiveTypes = Table.SelectColumns(Source, Table.ColumnsOfType(Source, {type nullable number, type nullable text, type nullable logical, type nullable date, type nullable datetime, type nullable datetimezone, type nullable time, type nullable duration})),
    recordTypeFields = Type.RecordFields(Type.TableRow(Value.Type(tableWithOnlyPrimitiveTypes))),
    fieldNames = Record.FieldNames(recordTypeFields),
    fieldTypes = List.Transform(Record.ToList(recordTypeFields), each [Type]),
    pairs = List.Transform(List.Positions(fieldNames), (i) => {fieldNames{i}, (v) => if v = null or Value.Is(v, fieldTypes{i}) then v else error [Message = "The type of the value does not match the type of the column.", Detail = v], fieldTypes{i}})
in
    Table.TransformColumns(Source, pairs),
  #"Added Index" = Table.AddIndexColumn(#"Detected Type Mismatches", "Row Number" ,1),
  #"Kept Errors" = Table.SelectRowsWithErrors(#"Added Index", {"borders", "delay_category_name", "delay_category_id"}),
  #"Reordered Columns" = Table.ReorderColumns(#"Kept Errors", {"Row Number", "borders", "delay_category_name", "delay_category_id"})
in
  #"Reordered Columns"


The source table's datatypes are: 
border --> DOUBLE
delay_category_name --> STRING
delay_category_id --> INT

  • Anonymous's avatar
    Anonymous
    3 years ago

    UPDATE: 

    Okay so we have found out that we had a -Infinity value in the field and once we excluded the that everything loaded normally. 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    UPDATE: 

    Okay so we have found out that we had a -Infinity value in the field and once we excluded the that everything loaded normally. 

    • v-jingzhang's avatar
      v-jingzhang
      Community Support

      Hi Anonymous 

       

      Great you have found the cause of the error! Since it's solved, you can accept your UPDATE reply as solution to help close this thread. Thank you!

       

      Best Regards,
      Community Support Team _ Jing