diff --git a/datafusion/sql/src/expr/value.rs b/datafusion/sql/src/expr/value.rs index df9e44be3f2d..f1c93d8bdc3a 100644 --- a/datafusion/sql/src/expr/value.rs +++ b/datafusion/sql/src/expr/value.rs @@ -49,6 +49,8 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { fn parse_sql_number(&self, n: &str) -> Result { if let Ok(n) = n.parse::() { Ok(lit(n)) + } else if let Ok(n) = n.parse::() { + Ok(lit(n)) } else if self.options.parse_float_as_decimal { // remove leading zeroes let str = n.trim_start_matches('0'); diff --git a/datafusion/sql/tests/integration_test.rs b/datafusion/sql/tests/integration_test.rs index 64ca85b72d98..a69a824a3eea 100644 --- a/datafusion/sql/tests/integration_test.rs +++ b/datafusion/sql/tests/integration_test.rs @@ -56,6 +56,11 @@ fn parse_decimals() { "10000000000000000000.00", "Decimal128(Some(1000000000000000000000),22,2)", ), + ("18446744073709551615", "UInt64(18446744073709551615)"), + ( + "18446744073709551616", + "Decimal128(Some(18446744073709551616),38,0)", + ), ]; for (a, b) in test_data { let sql = format!("SELECT {a}");