(dt arrow.DataType)
| 42 | } |
| 43 | |
| 44 | func arrowToDuckDB(dt arrow.DataType) string { |
| 45 | switch dt := dt.(type) { |
| 46 | case *arrow.StructType, *arrow.MapType: |
| 47 | return "json" |
| 48 | case arrow.ListLikeType: |
| 49 | return arrowToDuckDB(dt.Elem()) + "[]" |
| 50 | case *arrow.BooleanType: |
| 51 | return "boolean" |
| 52 | case *arrow.Int8Type: |
| 53 | return "tinyint" |
| 54 | case *arrow.Int16Type: |
| 55 | return "smallint" |
| 56 | case *arrow.Int32Type: |
| 57 | return "integer" |
| 58 | case *arrow.Int64Type: |
| 59 | return "bigint" |
| 60 | case *arrow.Uint8Type: |
| 61 | return "uinteger" |
| 62 | case *arrow.Uint16Type: |
| 63 | return "uinteger" |
| 64 | case *arrow.Uint32Type: |
| 65 | return "uinteger" |
| 66 | case *arrow.Uint64Type: |
| 67 | return "ubigint" |
| 68 | case *arrow.Float32Type: |
| 69 | return "float" |
| 70 | case *arrow.Float64Type: |
| 71 | return "double" |
| 72 | case *arrow.BinaryType: |
| 73 | return "blob" |
| 74 | case *arrow.LargeBinaryType: |
| 75 | return "blob" |
| 76 | case *types.UUIDType: |
| 77 | return "uuid" |
| 78 | case *types.JSONType: |
| 79 | return "json" |
| 80 | case *arrow.Date32Type, *arrow.Date64Type, *arrow.TimestampType: |
| 81 | return "timestamp" |
| 82 | default: |
| 83 | return "varchar" |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | func duckDBToArrow(t string) arrow.DataType { |
| 88 | switch { |
no outgoing calls
no test coverage detected