@@ -483,7 +483,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
483483 fn make_data_type ( & self , sql_type : & SQLDataType ) -> Result < DataType > {
484484 match sql_type {
485485 SQLDataType :: BigInt ( _) => Ok ( DataType :: Int64 ) ,
486- SQLDataType :: Int ( _) => Ok ( DataType :: Int32 ) ,
486+ SQLDataType :: Int ( _) | SQLDataType :: Integer ( _ ) => Ok ( DataType :: Int32 ) ,
487487 SQLDataType :: SmallInt ( _) => Ok ( DataType :: Int16 ) ,
488488 SQLDataType :: Char ( _) | SQLDataType :: Varchar ( _) | SQLDataType :: Text => {
489489 Ok ( DataType :: Utf8 )
@@ -498,7 +498,30 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
498498 SQLDataType :: Date => Ok ( DataType :: Date32 ) ,
499499 SQLDataType :: Time => Ok ( DataType :: Time64 ( TimeUnit :: Nanosecond ) ) ,
500500 SQLDataType :: Timestamp => Ok ( DataType :: Timestamp ( TimeUnit :: Nanosecond , None ) ) ,
501- _ => Err ( DataFusionError :: NotImplemented ( format ! (
501+ // Explicitly list all other types so that if sqlparser
502+ // adds/changes the `SQLDataType` the compiler will tell us on upgrade
503+ // and avoid bugs like https://github.com/apache/arrow-datafusion/issues/3059
504+ SQLDataType :: Nvarchar ( _)
505+ | SQLDataType :: Uuid
506+ | SQLDataType :: Binary ( _)
507+ | SQLDataType :: Varbinary ( _)
508+ | SQLDataType :: Blob ( _)
509+ | SQLDataType :: TinyInt ( _)
510+ | SQLDataType :: UnsignedTinyInt ( _)
511+ | SQLDataType :: UnsignedSmallInt ( _)
512+ | SQLDataType :: UnsignedInt ( _)
513+ | SQLDataType :: UnsignedInteger ( _)
514+ | SQLDataType :: UnsignedBigInt ( _)
515+ | SQLDataType :: Datetime
516+ | SQLDataType :: Interval
517+ | SQLDataType :: Regclass
518+ | SQLDataType :: String
519+ | SQLDataType :: Bytea
520+ | SQLDataType :: Custom ( _)
521+ | SQLDataType :: Array ( _)
522+ | SQLDataType :: Enum ( _)
523+ | SQLDataType :: Set ( _)
524+ | SQLDataType :: Clob ( _) => Err ( DataFusionError :: NotImplemented ( format ! (
502525 "The SQL data type {:?} is not implemented" ,
503526 sql_type
504527 ) ) ) ,
0 commit comments