You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/03/25 15:42:23 UTC

[GitHub] [arrow-datafusion] alamb opened a new pull request, #5739: Minor: port some decimal tests to sqllogictests

alamb opened a new pull request, #5739:
URL: https://github.com/apache/arrow-datafusion/pull/5739

   # Which issue does this PR close?
   
   Part of https://github.com/apache/arrow-datafusion/issues/4495
   
   # Rationale for this change
   https://github.com/apache/arrow-datafusion/tree/main/datafusion/core/tests/sqllogictests#sqllogictests
   
   # What changes are included in this PR?
   Port some tests over
   
   # Are these changes tested?
   Yes
   # Are there any user-facing changes?
   No


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] comphead commented on a diff in pull request #5739: Minor: port some decimal tests to sqllogictests

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #5739:
URL: https://github.com/apache/arrow-datafusion/pull/5739#discussion_r1149461900


##########
datafusion/core/tests/sqllogictests/test_files/aggregate.slt:
##########
@@ -1524,3 +1524,17 @@ NULL
 
 query error DataFusion error: Execution error: aggregate function needs at least one non-null element
 select approx_median(a) from (select 1 as a where 1=0);
+
+
+# aggregate_decimal_sum
+query RT
+select sum(c1), arrow_typeof(sum(c1)) from d_table;
+----
+100 Decimal128(20, 3)
+
+
+# aggregate_decimal_avg
+query RT
+select avg(c1), arrow_typeof(avg(c1)) from d_table

Review Comment:
   👍  its not modified part of the code anyway



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5739: Minor: port some decimal tests to sqllogictests

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #5739:
URL: https://github.com/apache/arrow-datafusion/pull/5739#discussion_r1148535608


##########
datafusion/core/tests/sqllogictests/test_files/aggregate.slt:
##########
@@ -1524,3 +1524,17 @@ NULL
 
 query error DataFusion error: Execution error: aggregate function needs at least one non-null element
 select approx_median(a) from (select 1 as a where 1=0);
+
+
+# aggregate_decimal_sum
+query RT
+select sum(c1), arrow_typeof(sum(c1)) from d_table;
+----
+100 Decimal128(20, 3)
+
+
+# aggregate_decimal_avg
+query RT
+select avg(c1), arrow_typeof(avg(c1)) from d_table

Review Comment:
   I am not sure to be honest. Maybe @liukun4515  remembers why the type of `AVG` is different.  This PR just ports the previous check (that also verified the type) from
   
    https://github.com/apache/arrow-datafusion/pull/5739/files#diff-9766ab13aa508a77a8a7fb3e31ba2394e2308b475022ec8f38c3bc6a21d09f58L111
   ```rust
       assert_eq!(
           &DataType::Decimal128(14, 7),
           result[0].schema().field(0).data_type()
       );
   ```



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] comphead commented on a diff in pull request #5739: Minor: port some decimal tests to sqllogictests

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #5739:
URL: https://github.com/apache/arrow-datafusion/pull/5739#discussion_r1148396626


##########
datafusion/core/tests/sqllogictests/test_files/aggregate.slt:
##########
@@ -1524,3 +1524,17 @@ NULL
 
 query error DataFusion error: Execution error: aggregate function needs at least one non-null element
 select approx_median(a) from (select 1 as a where 1=0);
+
+
+# aggregate_decimal_sum
+query RT
+select sum(c1), arrow_typeof(sum(c1)) from d_table;
+----
+100 Decimal128(20, 3)
+
+
+# aggregate_decimal_avg
+query RT
+select avg(c1), arrow_typeof(avg(c1)) from d_table

Review Comment:
   looks good, just wondering why `arrow_typeof(sum(c1) == Decimal128(20, 3)`
   `arrow_typeof(avg(c1)) == Decimal128(14, 7)`
   
   is the data type size gets adjusted automatically?



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #5739: Minor: port some decimal tests to sqllogictests

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #5739:
URL: https://github.com/apache/arrow-datafusion/pull/5739


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org