- Notifications
You must be signed in to change notification settings - Fork328
add support for numerics#1324
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -990,6 +990,7 @@ impl Snapshot { | ||
"int8" => row[column.position].value::<i64>().unwrap().map(|v| v.to_string()), | ||
"float4" => row[column.position].value::<f32>().unwrap().map(|v| v.to_string()), | ||
"float8" => row[column.position].value::<f64>().unwrap().map(|v| v.to_string()), | ||
"numeric" => row[column.position].value::<AnyNumeric>().unwrap().map(|v| v.to_string()), | ||
"bpchar" | "text" | "varchar" => { | ||
Comment on lines 990 to 994
| ||
row[column.position].value::<String>().unwrap().map(|v| v.to_string()) | ||
} | ||
@@ -1078,6 +1079,14 @@ impl Snapshot { | ||
vector.push(j as f32) | ||
} | ||
} | ||
"numeric[]" => { | ||
let vec = row[column.position].value::<Vec<AnyNumeric>>().unwrap().unwrap(); | ||
check_column_size(column, vec.len()); | ||
for j in vec { | ||
vector.push(j.rescale::<6,0>().unwrap().try_into().unwrap()) | ||
} | ||
} | ||
_ => error!( | ||
"Unhandled type for quantitative array column: {} {:?}", | ||
column.name, column.pg_type | ||
@@ -1092,6 +1101,7 @@ impl Snapshot { | ||
"int8" => row[column.position].value::<i64>().unwrap().map(|v| v as f32), | ||
"float4" => row[column.position].value::<f32>().unwrap(), | ||
"float8" => row[column.position].value::<f64>().unwrap().map(|v| v as f32), | ||
"numeric" => row[column.position].value::<AnyNumeric>().unwrap().map(|v| v.rescale::<6,0>().unwrap().try_into().unwrap()), | ||
_ => error!( | ||
"Unhandled type for quantitative scalar column: {} {:?}", | ||
column.name, column.pg_type | ||
Comment on lines 1105 to 1107
| ||