spaydar opened a new issue, #8042:
URL: https://github.com/apache/arrow-datafusion/issues/8042

   ### Describe the bug
   
   When trying to complete Postgres-compatible sqllogictests in a new file 
[`pg_compat_timestamps` on 
`spaydar:7868`](https://github.com/spaydar/arrow-datafusion/commit/c964a2f29d3d55400dae3ee522e287c240287a16)
 for #7868, the build fails with errors indicating the `FromSql` trait is not 
implemented for `rust_decimal:Decimal`, `NaiveDate`, `NaiveTime`, and 
`NaiveDateTime`
   
   ### To Reproduce
   
   Run the following terminal command and observe the build failure output
   ```bash
   $ PG_COMPAT=true PG_URI="postgresql://[email protected]/postgres" cargo 
test --features=postgres --test sqllogictests -- pg_compat_timestamps --complete
      Compiling datafusion-sqllogictest v32.0.0 
(~/arrow-datafusion/datafusion/sqllogictest)
   error[E0277]: the trait bound `rust_decimal::Decimal: FromSql<'_>` is not 
satisfied
      --> datafusion/sqllogictest/src/engines/postgres_engine/mod.rs:306:38
       |
   306 |         let value: Option<$t> = $row.get($idx);
       |                                      ^^^ the trait `FromSql<'_>` is 
not implemented for `rust_decimal::Decimal`
   ...
   320 |         Type::NUMERIC => make_string!(row, idx, Decimal, 
decimal_to_str),
       |                          
----------------------------------------------- in this macro invocation
       |
       = help: the following other types implement trait `FromSql<'a>`:
                 bool
                 i8
                 i16
                 i32
                 i64
                 u32
                 f32
                 f64
               and 15 others
       = note: required for `Option<rust_decimal::Decimal>` to implement 
`FromSql<'_>`
   note: required by a bound in `tokio_postgres::Row::get`
      --> 
~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-postgres-0.7.10/src/row.rs:147:12
       |
   144 |     pub fn get<'a, I, T>(&'a self, idx: I) -> T
       |            --- required by a bound in this associated function
   ...
   147 |         T: FromSql<'a>,
       |            ^^^^^^^^^^^ required by this bound in `Row::get`
       = note: this error originates in the macro `make_string` (in Nightly 
builds, run with -Z macro-backtrace for more info)
   
   error[E0277]: the trait bound `NaiveDate: FromSql<'_>` is not satisfied
      --> datafusion/sqllogictest/src/engines/postgres_engine/mod.rs:299:38
       |
   299 |         let value: Option<$t> = $row.get($idx);
       |                                      ^^^ the trait `FromSql<'_>` is 
not implemented for `NaiveDate`
   ...
   321 |         Type::DATE => make_string!(row, idx, NaiveDate),
       |                       --------------------------------- in this macro 
invocation
       |
       = help: the following other types implement trait `FromSql<'a>`:
                 bool
                 i8
                 i16
                 i32
                 i64
                 u32
                 f32
                 f64
               and 15 others
       = note: required for `Option<NaiveDate>` to implement `FromSql<'_>`
   note: required by a bound in `tokio_postgres::Row::get`
      --> 
~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-postgres-0.7.10/src/row.rs:147:12
       |
   144 |     pub fn get<'a, I, T>(&'a self, idx: I) -> T
       |            --- required by a bound in this associated function
   ...
   147 |         T: FromSql<'a>,
       |            ^^^^^^^^^^^ required by this bound in `Row::get`
       = note: this error originates in the macro `make_string` (in Nightly 
builds, run with -Z macro-backtrace for more info)
   
   error[E0277]: the trait bound `NaiveTime: FromSql<'_>` is not satisfied
      --> datafusion/sqllogictest/src/engines/postgres_engine/mod.rs:299:38
       |
   299 |         let value: Option<$t> = $row.get($idx);
       |                                      ^^^ the trait `FromSql<'_>` is 
not implemented for `NaiveTime`
   ...
   322 |         Type::TIME => make_string!(row, idx, NaiveTime),
       |                       --------------------------------- in this macro 
invocation
       |
       = help: the following other types implement trait `FromSql<'a>`:
                 bool
                 i8
                 i16
                 i32
                 i64
                 u32
                 f32
                 f64
               and 15 others
       = note: required for `Option<NaiveTime>` to implement `FromSql<'_>`
   note: required by a bound in `tokio_postgres::Row::get`
      --> 
~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-postgres-0.7.10/src/row.rs:147:12
       |
   144 |     pub fn get<'a, I, T>(&'a self, idx: I) -> T
       |            --- required by a bound in this associated function
   ...
   147 |         T: FromSql<'a>,
       |            ^^^^^^^^^^^ required by this bound in `Row::get`
       = note: this error originates in the macro `make_string` (in Nightly 
builds, run with -Z macro-backtrace for more info)
   
   error[E0277]: the trait bound `NaiveDateTime: FromSql<'_>` is not satisfied
      --> datafusion/sqllogictest/src/engines/postgres_engine/mod.rs:324:52
       |
   324 |             let value: Option<NaiveDateTime> = row.get(idx);
       |                                                    ^^^ the trait 
`FromSql<'_>` is not implemented for `NaiveDateTime`
       |
       = help: the following other types implement trait `FromSql<'a>`:
                 bool
                 i8
                 i16
                 i32
                 i64
                 u32
                 f32
                 f64
               and 15 others
       = note: required for `Option<NaiveDateTime>` to implement `FromSql<'_>`
   note: required by a bound in `tokio_postgres::Row::get`
      --> 
~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-postgres-0.7.10/src/row.rs:147:12
       |
   144 |     pub fn get<'a, I, T>(&'a self, idx: I) -> T
       |            --- required by a bound in this associated function
   ...
   147 |         T: FromSql<'a>,
       |            ^^^^^^^^^^^ required by this bound in `Row::get`
   
   For more information about this error, try `rustc --explain E0277`.
   error: could not compile `datafusion-sqllogictest` (lib) due to 4 previous 
errors
   
   ```
   
   ### Expected behavior
   
   A successful build and sqllogictest completion
   
   ### Additional context
   
   I can investigate possible solutions e.g. implementing the trait, but 
thought I'd raise this with the community if someone more familiar knows a 
quick fix for this


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