This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new ca23ecd803 test: parquet use the byte array as the physical type to 
store decimal (#6851)
ca23ecd803 is described below

commit ca23ecd803b9cbae4e4c6af0d3f93260e4774d53
Author: jokercurry <[email protected]>
AuthorDate: Sat Jul 8 20:02:24 2023 +0800

    test: parquet use the byte array as the physical type to store decimal 
(#6851)
    
    Co-authored-by: zhongjingxiong <[email protected]>
---
 datafusion/core/src/datasource/file_format/parquet.rs | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/datafusion/core/src/datasource/file_format/parquet.rs 
b/datafusion/core/src/datasource/file_format/parquet.rs
index 875c58ae44..6cda0fe68b 100644
--- a/datafusion/core/src/datasource/file_format/parquet.rs
+++ b/datafusion/core/src/datasource/file_format/parquet.rs
@@ -1181,10 +1181,13 @@ mod tests {
         let column = batches[0].column(0);
         assert_eq!(&DataType::Decimal128(13, 2), column.data_type());
 
-        // parquet use the fixed length binary as the physical type to store 
decimal
-        // TODO: arrow-rs don't support convert the physical type of binary to 
decimal
-        // https://github.com/apache/arrow-rs/pull/2160
-        // let exec = get_exec(&session_ctx, "byte_array_decimal.parquet", 
None, None).await?;
+        // parquet use the byte array as the physical type to store decimal
+        let exec = get_exec(&state, "byte_array_decimal.parquet", None, 
None).await?;
+        let batches = collect(exec, task_ctx.clone()).await?;
+        assert_eq!(1, batches.len());
+        assert_eq!(1, batches[0].num_columns());
+        let column = batches[0].column(0);
+        assert_eq!(&DataType::Decimal128(4, 2), column.data_type());
 
         Ok(())
     }

Reply via email to