You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to complete Postgres-compatible sqllogictests in a new file pg_compat_timestamps on spaydar:7868 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
$ PG_COMPAT=true PG_URI="postgresql://postgres@127.0.0.1/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
The text was updated successfully, but these errors were encountered:
Describe the bug
When trying to complete Postgres-compatible sqllogictests in a new file
pg_compat_timestamps
onspaydar:7868
for #7868, the build fails with errors indicating theFromSql
trait is not implemented forrust_decimal:Decimal
,NaiveDate
,NaiveTime
, andNaiveDateTime
To Reproduce
Run the following terminal command and observe the build failure output
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
The text was updated successfully, but these errors were encountered: