-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support INTEGER
again in addition to INT
in CREATE TABLE
and CAST
statements
#3167
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -483,7 +483,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { | |
fn make_data_type(&self, sql_type: &SQLDataType) -> Result<DataType> { | ||
match sql_type { | ||
SQLDataType::BigInt(_) => Ok(DataType::Int64), | ||
SQLDataType::Int(_) => Ok(DataType::Int32), | ||
SQLDataType::Int(_) | SQLDataType::Integer(_) => Ok(DataType::Int32), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the fix |
||
SQLDataType::SmallInt(_) => Ok(DataType::Int16), | ||
SQLDataType::Char(_) | SQLDataType::Varchar(_) | SQLDataType::Text => { | ||
Ok(DataType::Utf8) | ||
|
@@ -498,7 +498,30 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { | |
SQLDataType::Date => Ok(DataType::Date32), | ||
SQLDataType::Time => Ok(DataType::Time64(TimeUnit::Nanosecond)), | ||
SQLDataType::Timestamp => Ok(DataType::Timestamp(TimeUnit::Nanosecond, None)), | ||
_ => Err(DataFusionError::NotImplemented(format!( | ||
// Explicitly list all other types so that if sqlparser | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not change the behavior, but makes the current behavior more explicit in my opinion It also makes clear some surprising things (like several |
||
// adds/changes the `SQLDataType` the compiler will tell us on upgrade | ||
// and avoid bugs like https://github.com/apache/arrow-datafusion/issues/3059 | ||
SQLDataType::Nvarchar(_) | ||
| SQLDataType::Uuid | ||
| SQLDataType::Binary(_) | ||
| SQLDataType::Varbinary(_) | ||
| SQLDataType::Blob(_) | ||
| SQLDataType::TinyInt(_) | ||
| SQLDataType::UnsignedTinyInt(_) | ||
| SQLDataType::UnsignedSmallInt(_) | ||
| SQLDataType::UnsignedInt(_) | ||
| SQLDataType::UnsignedInteger(_) | ||
| SQLDataType::UnsignedBigInt(_) | ||
| SQLDataType::Datetime | ||
| SQLDataType::Interval | ||
| SQLDataType::Regclass | ||
| SQLDataType::String | ||
| SQLDataType::Bytea | ||
| SQLDataType::Custom(_) | ||
| SQLDataType::Array(_) | ||
| SQLDataType::Enum(_) | ||
| SQLDataType::Set(_) | ||
| SQLDataType::Clob(_) => Err(DataFusionError::NotImplemented(format!( | ||
"The SQL data type {:?} is not implemented", | ||
sql_type | ||
))), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with this change, many of the
sql_integration
tests fail