ovr commented on a change in pull request #9139:
URL: https://github.com/apache/arrow/pull/9139#discussion_r554425163
##########
File path: rust/datafusion/tests/sql.rs
##########
@@ -1859,19 +1859,33 @@ async fn crypto_expressions() -> Result<()> {
let mut ctx = ExecutionContext::new();
let sql = "SELECT
md5('tom') AS md5_tom,
+ md5('') AS md5_empty_str,
+ md5(null) AS md5_null,
sha224('tom') AS sha224_tom,
+ sha224('') AS sha224_empty_str,
+ sha224(null) AS sha224_null,
sha256('tom') AS sha256_tom,
+ sha256('') AS sha256_empty_str,
sha384('tom') AS sha348_tom,
- sha512('tom') AS sha512_tom
+ sha384('') AS sha384_empty_str,
+ sha512('tom') AS sha512_tom,
+ sha512('') AS sha512_empty_str
";
let actual = execute(&mut ctx, sql).await;
let expected = vec![vec![
"34b7da764b21d298ef307d04d8152dc5",
- "BF6CB62649C42A9AE3876AB6F6D92AD36CB5414E495F8873292BE4D",
- "E1608F75C5D7813F3D4031CB30BFB786507D98137538FF8E128A6FF74E84E643",
-
"96F5B68AA77848E4FDF5C1CB35DE2DBFAD6FFD7C25D9EA7C6C19B8A4D55A9187EB117C557883F58C16DFAC3E343",
-
"6E1B9B3FE84068E3751F7AD5E959D6F39AD0F8885D855166F55C659469D3C8B78118C44A2A49C72DDB481CD6D8731034E11CC0307BA843A9B3495CB8D3E"
+ "d41d8cd98f00b204e9800998ecf8427e",
Review comment:
Tested with real PostgreSQL.
```sql
select
md5('tom') AS md5_tom,
md5('') AS md5_empty_str,
md5(null) AS md5_null,
encode(sha224('tom'), 'hex') AS sha224_tom,
encode(sha224(''), 'hex') AS sha224_empty_str,
sha224(null) AS sha224_null;
```
```json
[
{
"md5_tom": "34b7da764b21d298ef307d04d8152dc5",
"md5_empty_str": "d41d8cd98f00b204e9800998ecf8427e",
"md5_null": null,
"sha224_tom": "0bf6cb62649c42a9ae3876ab6f6d92ad36cb5414e495f8873292be4d",
"sha224_empty_str":
"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f",
"sha224_null": null
}
]
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]