mapleFU opened a new issue, #37799:
URL: https://github.com/apache/arrow/issues/37799

   ### Describe the enhancement requested
   
   This is a part of https://github.com/apache/arrow/issues/37111 .
   
   ```
   TEST_P(TestParquetFileFormatScan, 
PredicatePushdownRowGroupFragmentsUsingTimestampColumn) {
     for (auto time_unit : {TimeUnit::MILLI, TimeUnit::SECOND}) {
       auto table = TableFromJSON(schema({field("t", time32(time_unit))}),
                                  {
                                      R"([{"t": 1}])",
                                      R"([{"t": 2}, {"t": 3}])",
                                  });
       TableBatchReader table_reader(*table);
       SCOPED_TRACE(
           
"TestParquetFileFormatScan.PredicatePushdownRowGroupFragmentsUsingTimestampColumn");
       ASSERT_OK_AND_ASSIGN(
           auto buffer,
           ParquetFormatHelper::Write(
               &table_reader, 
ArrowWriterProperties::Builder().store_schema()->build()));
       auto source = std::make_shared<FileSource>(buffer);
       SetSchema({field("t", time32(time_unit))});
       ASSERT_OK_AND_ASSIGN(auto fragment, format_->MakeFragment(*source));
   
       auto expr =
           equal(field_ref("t"), literal(::arrow::Time32Scalar(1, time_unit)));
       CountRowGroupsInFragment(fragment, {0}, expr);
     }
   }
   ```
   
   With the reproduce code above, `TimeUnit::MILLI` will pass the test, but 
`TimeUnit::SECOND` will suffer from 
   
   ```
   function 'equal' has no kernel matching input types (time32[s], time32[ms])
   ```
   
   This is because:
   
   1. During writing, `SECOND` will be cast to other type, see [1]
   2. During reading, we don't support `eq(time32[s], time32[ms)`
   
   [1] 
https://github.com/apache/arrow/blob/main/cpp/src/parquet/arrow/schema.cc#L231-L238
   
   ### Component(s)
   
   C++, Parquet


-- 
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]

Reply via email to