alamb commented on code in PR #5086:
URL: https://github.com/apache/arrow-datafusion/pull/5086#discussion_r1089417112
##########
datafusion/core/tests/sql/decimal.rs:
##########
@@ -18,839 +18,256 @@
use super::*;
#[tokio::test]
-async fn decimal_cast() -> Result<()> {
+async fn decimal_cast_precision() -> Result<()> {
let ctx = SessionContext::new();
let sql = "select cast(1.23 as decimal(10,4))";
let actual = execute_to_batches(&ctx, sql).await;
assert_eq!(
Review Comment:
Like below, I think you can write these tests using `arrow_typeof` -- like
```sql
❯ select arrow_typeof(cast(1.23 as decimal(10,4)));
+----------------------------+
| arrowtypeof(Float64(1.23)) |
+----------------------------+
| Decimal128(10, 4) |
+----------------------------+
```
##########
datafusion/core/tests/sql/decimal.rs:
##########
@@ -879,37 +296,3 @@ async fn decimal_null_array_scalar_comparison() ->
Result<()> {
assert_eq!(&DataType::Boolean, actual[0].column(0).data_type());
Review Comment:
I wonder if you could use `arrow_typeof` to do the check
```sql
❯ select null <= a from (values (1.1::decimal)) as t(a);
+-----------+
| NULL <= a |
+-----------+
| |
+-----------+
1 row in set. Query took 0.029 seconds.
❯ select arrow_typeof(null <= a) from (values (1.1::decimal)) as t(a);
+------------------------+
| arrowtypeof(NULL <= a) |
+------------------------+
| Boolean |
+------------------------+
1 row in set. Query took 0.006 seconds.
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]