Eason0729 commented on issue #12655:
URL: https://github.com/apache/datafusion/issues/12655#issuecomment-2380432919

   I guess datafusion use `f64` by default(you need `CAST(1.3 AS float)`).
   
   ```rust
   #[tokio::test]
   async fn dev_test()->Result<()>{
       let ctx = SessionContext::new();
   
       ctx.sql("create table test(col float);").await?.show().await?;
       ctx.sql("insert into test values (1.1), (1.2), (1.3), (1.4), 
(1.5);").await?.show().await?;
       ctx.sql("select * from test where col > CAST(1.3 AS 
float);").await?.show().await?;
       ctx.sql("select * from test where col < CAST(1.3 AS 
float)").await?.show().await?;
   
       Ok(())
   }
   ```
   
   It print out following
   ```
   ++
   ++
   +-------+
   | count |
   +-------+
   | 5     |
   +-------+
   +-----+
   | col |
   +-----+
   | 1.4 |
   | 1.5 |
   +-----+
   +-----+
   | col |
   +-----+
   | 1.1 |
   | 1.2 |
   +-----+
   ```
   
   Tell me if it works in datafusion-cli.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to