Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions datafusion/sql/src/expr/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
fn parse_sql_number(&self, n: &str) -> Result<Expr> {
if let Ok(n) = n.parse::<i64>() {
Ok(lit(n))
} else if let Ok(n) = n.parse::<u64>() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackkleeman please run cargo fmt --all and resubmit the PR

Ok(lit(n))
} else if self.options.parse_float_as_decimal {
// remove leading zeroes
let str = n.trim_start_matches('0');
Expand Down
5 changes: 5 additions & 0 deletions datafusion/sql/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down