liukun4515 commented on a change in pull request #1431: URL: https://github.com/apache/arrow-datafusion/pull/1431#discussion_r767059652
########## File path: datafusion/src/sql/planner.rs ########## @@ -372,7 +372,27 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { SQLDataType::Char(_) | SQLDataType::Varchar(_) | SQLDataType::Text => { Ok(DataType::Utf8) } - SQLDataType::Decimal(_, _) => Ok(DataType::Float64), + SQLDataType::Decimal(precision, scale) => { + match (precision, scale) { + (None, _) | (_, None) => { + return Err(DataFusionError::Internal(format!( + "Error Decimal Type ({:?})", + sql_type + ))); + } + (Some(p), Some(s)) => { + // TODO add bound checker in some utils file or function + if *p > 38 || *s > *p { + return Err(DataFusionError::Internal(format!( + "Error Decimal Type ({:?})", Review comment: Thanks for your suggestion. It has been modified. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org