diff --git a/delta-inspect/Cargo.lock b/delta-inspect/Cargo.lock index 92ffc3882c..eb21e53611 100644 --- a/delta-inspect/Cargo.lock +++ b/delta-inspect/Cargo.lock @@ -62,9 +62,9 @@ checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" [[package]] name = "arrow" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed9849f86164fad5cb66ce4732782b15f1bc97f8febab04e782c20cce9d4b6c" +checksum = "2fe17dc0113da7e2eaeaedbd304d347aa8ea64916d225b79a5c3f3b6b5d8da4c" dependencies = [ "ahash", "arrow-array", @@ -74,22 +74,23 @@ dependencies = [ "arrow-data", "arrow-ipc", "arrow-json", + "arrow-ord", "arrow-schema", "arrow-select", + "arrow-string", "chrono", "half", "hashbrown 0.13.1", "multiversion", "num", "regex", - "regex-syntax", ] [[package]] name = "arrow-array" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8504cf0a6797e908eecf221a865e7d339892720587f87c8b90262863015b08" +checksum = "b9452131e027aec3276e43449162af084db611c42ef875e54d231e6580bc6254" dependencies = [ "ahash", "arrow-buffer", @@ -103,9 +104,9 @@ dependencies = [ [[package]] name = "arrow-buffer" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6de64a27cea684b24784647d9608314bc80f7c4d55acb44a425e05fab39d916" +checksum = "4a301001e8ed7da638a12fa579ac5f3f154c44c0655f2ca6ed0f8586b418a779" dependencies = [ "half", "num", @@ -113,9 +114,9 @@ dependencies = [ [[package]] name = "arrow-cast" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec4a54502eefe05923c385c90a005d69474fa06ca7aa2a2b123c9f9532f6178" +checksum = "048c91d067f2eb8cc327f086773e5b0f0d7714780807fc4db09366584e23bac8" dependencies = [ "arrow-array", "arrow-buffer", @@ -129,9 +130,9 @@ dependencies = [ [[package]] name = "arrow-csv" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7902bbf8127eac48554fe902775303377047ad49a9fd473c2b8cb399d092080" +checksum = "ed914cd0006a3bb9cac8136b3098ac7796ad26b82362f00d4f2e7c1a54684b86" dependencies = [ "arrow-array", "arrow-buffer", @@ -147,9 +148,9 @@ dependencies = [ [[package]] name = "arrow-data" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4882efe617002449d5c6b5de9ddb632339074b36df8a96ea7147072f1faa8a" +checksum = "e59619d9d102e4e6b22087b2bd60c07df76fcb68683620841718f6bc8e8f02cb" dependencies = [ "arrow-buffer", "arrow-schema", @@ -159,9 +160,9 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0703a6de2785828561b03a4d7793ecd333233e1b166316b4bfc7cfce55a4a7" +checksum = "fb7ad6d2fa06a1cebdaa213c59fc953b9230e560d8374aba133b572b864ec55e" dependencies = [ "arrow-array", "arrow-buffer", @@ -173,9 +174,9 @@ dependencies = [ [[package]] name = "arrow-json" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd23fc8c6d251f96cd63b96fece56bbb9710ce5874a627cb786e2600673595a" +checksum = "1e22efab3ad70336057660c5e5f2b72e2417e3444c27cb42dc477d678ddd6979" dependencies = [ "arrow-array", "arrow-buffer", @@ -189,17 +190,31 @@ dependencies = [ "serde_json", ] +[[package]] +name = "arrow-ord" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e23b623332804a65ad11e7732c351896dcb132c19f8e25d99fdb13b00aae5206" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "arrow-select", + "num", +] + [[package]] name = "arrow-schema" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f143882a80be168538a60e298546314f50f11f2a288c8d73e11108da39d26" +checksum = "69ef17c144f1253b9864f5a3e8f4c6f1e436bdd52394855d5942f132f776b64e" [[package]] name = "arrow-select" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520406331d4ad60075359524947ebd804e479816439af82bcb17f8d280d9b38c" +checksum = "e2accaf218ff107e3df0ee8f1e09b092249a1cc741c4377858a1470fd27d7096" dependencies = [ "arrow-array", "arrow-buffer", @@ -208,6 +223,21 @@ dependencies = [ "num", ] +[[package]] +name = "arrow-string" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a0954f9e1f45b04815ddacbde72899bf3c03a08fa6c0375f42178c4a01a510" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "arrow-select", + "regex", + "regex-syntax", +] + [[package]] name = "async-trait" version = "0.1.60" @@ -238,9 +268,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aws-config" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a636c44c77fa18bdba56126a34d30cfe5538fe88f7d34988fa731fee143ddd" +checksum = "e7688e1dfbb9f7804fab0a830820d7e827b8d973906763cf1a855ce4719292f5" dependencies = [ "aws-http", "aws-sdk-sso", @@ -266,9 +296,9 @@ dependencies = [ [[package]] name = "aws-endpoint" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca8f374874f6459aaa88dc861d7f5d834ca1ff97668eae190e97266b5f6c3fb" +checksum = "253d7cd480bfa59a5323390e9e91885a8f06a275e0517d81eeb1070b6aa7d271" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -280,9 +310,9 @@ dependencies = [ [[package]] name = "aws-http" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78d41e19e779b73463f5f0c21b3aacc995f4ba783ab13a7ae9f5dfb159a551b4" +checksum = "4cd1b83859383e46ea8fda633378f9f3f02e6e3a446fd89f0240b5c3662716c9" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -298,9 +328,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86dcb1cb71aa8763b327542ead410424515cff0cde5b753eedd2917e09c63734" +checksum = "bf03342c2b3f52b180f484e60586500765474f2bfc7dcd4ffe893a7a1929db1d" dependencies = [ "aws-endpoint", "aws-http", @@ -320,9 +350,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdfcf584297c666f6b472d5368a78de3bc714b6e0a53d7fbf76c3e347c292ab1" +checksum = "aa1de4e07ea87a30a317c7b563b3a40fd18a843ad794216dda81672b6e174bce" dependencies = [ "aws-endpoint", "aws-http", @@ -338,13 +368,14 @@ dependencies = [ "bytes", "http", "tower", + "tracing", ] [[package]] name = "aws-sig-auth" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cbe7b2be9e185c1fbce27fc9c41c66b195b32d89aa099f98768d9544221308" +checksum = "6126c4ff918e35fb9ae1bf2de71157fad36f0cc6a2b1d0f7197ee711713700fc" dependencies = [ "aws-sigv4", "aws-smithy-http", @@ -355,27 +386,28 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ff4cff8c4a101962d593ba94e72cd83891aecd423f0c6e3146bff6fb92c9e3" +checksum = "84c7f88d7395f5411c6eef5889b6cd577ce6b677af461356cbfc20176c26c160" dependencies = [ "aws-smithy-http", "form_urlencoded", "hex", + "hmac 0.12.1", "http", "once_cell", "percent-encoding", "regex", - "ring", + "sha2 0.10.6", "time", "tracing", ] [[package]] name = "aws-smithy-async" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3442b4c5d3fc39891a2e5e625735fba6b24694887d49c6518460fde98247a9" +checksum = "3e6a895d68852dd1564328e63ef1583e5eb307dd2a5ebf35d862a5c402957d5e" dependencies = [ "futures-util", "pin-project-lite", @@ -385,9 +417,9 @@ dependencies = [ [[package]] name = "aws-smithy-client" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28d553714f8f54cd921227934fc13a536a1c03f106e56b362fd57e16d450ad" +checksum = "f505bf793eb3e6d7c166ef1275c27b4b2cd5361173fe950ac8e2cfc08c29a7ef" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -408,9 +440,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf58ed4fefa61dbf038e5421a521cbc2c448ef69deff0ab1d915d8a10eda5664" +checksum = "37e4b4304b7ea4af1af3e08535100eb7b6459d5a6264b92078bf85176d04ab85" dependencies = [ "aws-smithy-types", "bytes", @@ -428,11 +460,12 @@ dependencies = [ [[package]] name = "aws-smithy-http-tower" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c96d7bd35e7cf96aca1134b2f81b1b59ffe493f7c6539c051791cbbf7a42d3" +checksum = "e86072ecc4dc4faf3e2071144285cfd539263fe7102b701d54fb991eafb04af8" dependencies = [ "aws-smithy-http", + "aws-smithy-types", "bytes", "http", "http-body", @@ -443,18 +476,18 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8324ba98c8a94187723cc16c37aefa09504646ee65c3d2c3af495bab5ea701b" +checksum = "9e3ddd9275b167bc59e9446469eca56177ec0b51225632f90aaa2cd5f41c940e" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83834ed2ff69ea6f6657baf205267dc2c0abe940703503a3e5d60ce23be3d306" +checksum = "13b19d2e0b3ce20e460bad0d0d974238673100edebba6978c2c1aadd925602f7" dependencies = [ "aws-smithy-types", "urlencoding", @@ -462,10 +495,11 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b02e06ea63498c43bc0217ea4d16605d4e58d85c12fc23f6572ff6d0a840c61" +checksum = "987b1e37febb9bd409ca0846e82d35299e572ad8279bc404778caeb5fc05ad56" dependencies = [ + "base64-simd", "itoa 1.0.5", "num-integer", "ryu", @@ -474,18 +508,18 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246e9f83dd1fdf5d347fa30ae4ad30a9d1d42ce4cd74a93d94afa874646f94cd" +checksum = "37ce3791e14eec75ffac851a5a559f1ce6b31843297f42cc8bfba82714a6a5d8" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05701d32da168b44f7ee63147781aed8723e792cc131cb9b18363b5393f17f70" +checksum = "6c05adca3e2bcf686dd2c47836f216ab52ed7845c177d180c84b08522c1166a3" dependencies = [ "aws-smithy-async", "aws-smithy-client", @@ -503,6 +537,21 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" + +[[package]] +name = "base64-simd" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +dependencies = [ + "simd-abstraction", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -518,6 +567,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + [[package]] name = "brotli" version = "3.3.4" @@ -703,6 +761,16 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "crypto-mac" version = "0.11.1" @@ -803,6 +871,7 @@ dependencies = [ "errno", "futures", "glibc_version", + "itertools", "lazy_static", "libc", "log", @@ -836,6 +905,17 @@ dependencies = [ "generic-array", ] +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -1091,10 +1171,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -1182,7 +1260,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ "crypto-mac", - "digest", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", ] [[package]] @@ -1262,6 +1349,7 @@ dependencies = [ "rustls-native-certs", "tokio", "tokio-rustls", + "webpki-roots", ] [[package]] @@ -1551,8 +1639,8 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.9.0", + "digest 0.9.0", "opaque-debug", ] @@ -1716,18 +1804,17 @@ dependencies = [ [[package]] name = "object_store" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0014545954c5023b5fb8260415e54467cde434db6c824c9028a4b329f1b28e48" +checksum = "b4201837dc4c27a8670f0363b1255cd3845a4f0c521211cced1ed14c1d0cc6d2" dependencies = [ "async-trait", "aws-config", "aws-types", - "base64", + "base64 0.20.0", "bytes", "chrono", "futures", - "getrandom", "itertools", "parking_lot", "percent-encoding", @@ -1817,6 +1904,12 @@ version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +[[package]] +name = "outref" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" + [[package]] name = "parking_lot" version = "0.12.1" @@ -1842,9 +1935,9 @@ dependencies = [ [[package]] name = "parquet" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21433e9209111bb3720b747f2f137e0d115af1af0420a7a1c26b6e88227fa353" +checksum = "d906343fd18ace6b998d5074697743e8e9358efa8c3c796a1381b98cba813338" dependencies = [ "ahash", "arrow-array", @@ -1854,7 +1947,7 @@ dependencies = [ "arrow-ipc", "arrow-schema", "arrow-select", - "base64", + "base64 0.13.1", "brotli", "bytes", "chrono", @@ -1946,9 +2039,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.26.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f50b1c63b38611e7d4d7f68b82d3ad0cc71a2ad2e7f61fc10f1328d917c93cd" +checksum = "ffc053f057dd768a56f62cd7e434c42c831d296968997e9ac1f76ea7c2d14c41" dependencies = [ "memchr", "serde", @@ -2051,7 +2144,7 @@ version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ - "base64", + "base64 0.13.1", "bytes", "encoding_rs", "futures-core", @@ -2107,7 +2200,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db30db44ea73551326269adcf7a2169428a054f14faf9e1768f2163494f2fa2" dependencies = [ "async-trait", - "base64", + "base64 0.13.1", "bytes", "crc32fast", "futures", @@ -2177,13 +2270,13 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5ae95491c8b4847931e291b151127eccd6ff8ca13f33603eb3d0035ecb05272" dependencies = [ - "base64", + "base64 0.13.1", "bytes", "chrono", - "digest", + "digest 0.9.0", "futures", "hex", - "hmac", + "hmac 0.11.0", "http", "hyper", "log", @@ -2193,7 +2286,7 @@ dependencies = [ "rusoto_credential", "rustc_version", "serde", - "sha2", + "sha2 0.9.9", "tokio", ] @@ -2265,7 +2358,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" dependencies = [ - "base64", + "base64 0.13.1", ] [[package]] @@ -2399,13 +2492,24 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest", + "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + [[package]] name = "shlex" version = "1.1.0" @@ -2421,6 +2525,15 @@ dependencies = [ "libc", ] +[[package]] +name = "simd-abstraction" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" +dependencies = [ + "outref", +] + [[package]] name = "slab" version = "0.4.7" diff --git a/delta-inspect/src/main.rs b/delta-inspect/src/main.rs index 057450b930..98b431c498 100644 --- a/delta-inspect/src/main.rs +++ b/delta-inspect/src/main.rs @@ -66,15 +66,15 @@ async fn main() -> anyhow::Result<()> { }; if files_matches.is_present("full_uri") { - table.get_file_uris().for_each(|f| println!("{}", f)); + table.get_file_uris().for_each(|f| println!("{f}")); } else { - table.get_files_iter().for_each(|f| println!("{}", f)); + table.get_files_iter().for_each(|f| println!("{f}")); }; } Some(("info", info_matches)) => { let table_uri = info_matches.value_of("uri").unwrap(); let table = deltalake::open_table(table_uri).await?; - println!("{}", table); + println!("{table}"); } Some(("vacuum", vacuum_matches)) => { let dry_run = !vacuum_matches.is_present("no_dry_run"); @@ -91,9 +91,9 @@ async fn main() -> anyhow::Result<()> { ) .await?; if dry_run { - println!("Files to deleted: {:#?}", files); + println!("Files to deleted: {files:#?}"); } else { - println!("Files deleted: {:#?}", files); + println!("Files deleted: {files:#?}"); } } _ => unreachable!(), diff --git a/dynamodb_lock/src/lib.rs b/dynamodb_lock/src/lib.rs index bef745ab02..da10d1d847 100644 --- a/dynamodb_lock/src/lib.rs +++ b/dynamodb_lock/src/lib.rs @@ -701,29 +701,20 @@ mod tests { #[test] fn lock_options_default_test() { - std::env::set_var( - dynamo_lock_options::DYNAMO_LOCK_TABLE_NAME, - "some_table".to_string(), - ); - std::env::set_var( - dynamo_lock_options::DYNAMO_LOCK_OWNER_NAME, - "some_owner".to_string(), - ); + std::env::set_var(dynamo_lock_options::DYNAMO_LOCK_TABLE_NAME, "some_table"); + std::env::set_var(dynamo_lock_options::DYNAMO_LOCK_OWNER_NAME, "some_owner"); std::env::set_var( dynamo_lock_options::DYNAMO_LOCK_PARTITION_KEY_VALUE, - "some_pk".to_string(), - ); - std::env::set_var( - dynamo_lock_options::DYNAMO_LOCK_LEASE_DURATION, - "40".to_string(), + "some_pk", ); + std::env::set_var(dynamo_lock_options::DYNAMO_LOCK_LEASE_DURATION, "40"); std::env::set_var( dynamo_lock_options::DYNAMO_LOCK_REFRESH_PERIOD_MILLIS, - "2000".to_string(), + "2000", ); std::env::set_var( dynamo_lock_options::DYNAMO_LOCK_ADDITIONAL_TIME_TO_WAIT_MILLIS, - "3000".to_string(), + "3000", ); let options = DynamoDbOptions::default(); @@ -767,29 +758,20 @@ mod tests { #[test] fn lock_options_mixed_test() { - std::env::set_var( - dynamo_lock_options::DYNAMO_LOCK_TABLE_NAME, - "some_table".to_string(), - ); - std::env::set_var( - dynamo_lock_options::DYNAMO_LOCK_OWNER_NAME, - "some_owner".to_string(), - ); + std::env::set_var(dynamo_lock_options::DYNAMO_LOCK_TABLE_NAME, "some_table"); + std::env::set_var(dynamo_lock_options::DYNAMO_LOCK_OWNER_NAME, "some_owner"); std::env::set_var( dynamo_lock_options::DYNAMO_LOCK_PARTITION_KEY_VALUE, - "some_pk".to_string(), - ); - std::env::set_var( - dynamo_lock_options::DYNAMO_LOCK_LEASE_DURATION, - "40".to_string(), + "some_pk", ); + std::env::set_var(dynamo_lock_options::DYNAMO_LOCK_LEASE_DURATION, "40"); std::env::set_var( dynamo_lock_options::DYNAMO_LOCK_REFRESH_PERIOD_MILLIS, - "2000".to_string(), + "2000", ); std::env::set_var( dynamo_lock_options::DYNAMO_LOCK_ADDITIONAL_TIME_TO_WAIT_MILLIS, - "3000".to_string(), + "3000", ); let options = DynamoDbOptions::from_map(hashmap! { diff --git a/glibc_version/src/lib.rs b/glibc_version/src/lib.rs index d8f9c51765..0c65093664 100644 --- a/glibc_version/src/lib.rs +++ b/glibc_version/src/lib.rs @@ -33,7 +33,7 @@ mod imp { let version_str = ldd_output_to_version_str(output_str)?; parse_glibc_version(version_str) - .ok_or_else(|| format!("Invalid version string from ldd output: {}", version_str,)) + .ok_or_else(|| format!("Invalid version string from ldd output: {version_str}",)) } fn ldd_output_to_version_str(output_str: &str) -> Result<&str, String> { @@ -42,8 +42,7 @@ mod imp { Ok(captures.get(1).unwrap().as_str()) } else { Err(format!( - "ERROR: failed to detect glibc version. ldd output: {}", - output_str, + "ERROR: failed to detect glibc version. ldd output: {output_str}", )) } } diff --git a/python/src/filesystem.rs b/python/src/filesystem.rs index 2cd30c1a59..587c004f47 100644 --- a/python/src/filesystem.rs +++ b/python/src/filesystem.rs @@ -53,7 +53,7 @@ impl DeltaFileSystemHandler { fn normalize_path(&self, path: String) -> PyResult { let suffix = if path.ends_with('/') { "/" } else { "" }; let path = Path::parse(path).unwrap(); - Ok(format!("{}{}", path, suffix)) + Ok(format!("{path}{suffix}")) } fn copy_file(&self, src: String, dest: String) -> PyResult<()> { @@ -87,7 +87,7 @@ impl DeltaFileSystemHandler { } fn equals(&self, other: &DeltaFileSystemHandler) -> PyResult { - Ok(format!("{:?}", self) == format!("{:?}", other)) + Ok(format!("{self:?}") == format!("{other:?}")) } fn get_file_info<'py>(&self, paths: Vec, py: Python<'py>) -> PyResult> { @@ -313,14 +313,12 @@ impl ObjectInputFile { fn check_position(&self, position: i64, action: &str) -> PyResult<()> { if position < 0 { return Err(PyIOError::new_err(format!( - "Cannot {} for negative position.", - action + "Cannot {action} for negative position." ))); } if position > self.content_length { return Err(PyIOError::new_err(format!( - "Cannot {} past end of file.", - action + "Cannot {action} past end of file." ))); } Ok(()) diff --git a/python/src/lib.rs b/python/src/lib.rs index 6fc786be05..919672eab6 100644 --- a/python/src/lib.rs +++ b/python/src/lib.rs @@ -63,7 +63,7 @@ impl PyDeltaTableError { } fn from_chrono(err: chrono::ParseError) -> pyo3::PyErr { - PyDeltaTableError::new_err(format!("Parse date and time string failed: {}", err)) + PyDeltaTableError::new_err(format!("Parse date and time string failed: {err}")) } fn from_checkpoint(err: deltalake::checkpoints::CheckpointError) -> pyo3::PyErr { @@ -514,10 +514,7 @@ fn filestats_to_expression<'py>( schema .field_with_name(column_name) .map_err(|_| { - PyDeltaTableError::new_err(format!( - "Column not found in schema: {}", - column_name - )) + PyDeltaTableError::new_err(format!("Column not found in schema: {column_name}")) })? .data_type() .clone(), diff --git a/python/src/schema.rs b/python/src/schema.rs index 3df81e6efa..97aefdd541 100644 --- a/python/src/schema.rs +++ b/python/src/schema.rs @@ -135,8 +135,7 @@ impl PrimitiveType { if data_type.starts_with("decimal") { if try_parse_decimal_type(&data_type).is_none() { Err(PyValueError::new_err(format!( - "invalid decimal type: {}", - data_type + "invalid decimal type: {data_type}" ))) } else { Ok(Self { @@ -685,7 +684,7 @@ impl Field { .metadata(py)? .call_method0(py, "__repr__")? .extract(py)?; - format!(", metadata={}", metadata_repr) + format!(", metadata={metadata_repr}") }; Ok(format!( "Field({}, {}, nullable={}{})", diff --git a/rust/examples/read_delta_table.rs b/rust/examples/read_delta_table.rs index 127bb38d58..c225846fa4 100644 --- a/rust/examples/read_delta_table.rs +++ b/rust/examples/read_delta_table.rs @@ -2,6 +2,6 @@ async fn main() -> Result<(), deltalake::DeltaTableError> { let table_path = "./tests/data/delta-0.8.0"; let table = deltalake::open_table(table_path).await?; - println!("{}", table); + println!("{table}"); Ok(()) } diff --git a/rust/src/action/mod.rs b/rust/src/action/mod.rs index eab1fdff0b..b03b9abb30 100644 --- a/rust/src/action/mod.rs +++ b/rust/src/action/mod.rs @@ -50,7 +50,7 @@ fn decode_path(raw_path: &str) -> Result { percent_decode(raw_path.as_bytes()) .decode_utf8() .map(|c| c.to_string()) - .map_err(|e| ActionError::InvalidField(format!("Decode path failed for action: {}", e))) + .map_err(|e| ActionError::InvalidField(format!("Decode path failed for action: {e}"))) } /// Struct used to represent minValues and maxValues in add action statistics. diff --git a/rust/src/action/parquet_read/mod.rs b/rust/src/action/parquet_read/mod.rs index e12ddca2ef..d47f0b37f2 100644 --- a/rust/src/action/parquet_read/mod.rs +++ b/rust/src/action/parquet_read/mod.rs @@ -30,8 +30,7 @@ fn populate_hashmap_with_option_from_parquet_map( fn gen_action_type_error(action: &str, field: &str, expected_type: &str) -> ActionError { ActionError::InvalidField(format!( - "type for {} in {} action should be {}", - field, action, expected_type + "type for {field} in {action} action should be {expected_type}" )) } @@ -83,8 +82,7 @@ impl Add { ) .map_err(|estr| { ActionError::InvalidField(format!( - "Invalid partitionValues for add action: {}", - estr, + "Invalid partitionValues for add action: {estr}", )) })?; } @@ -104,8 +102,7 @@ impl Add { populate_hashmap_with_option_from_parquet_map(&mut tags, tags_map) .map_err(|estr| { ActionError::InvalidField(format!( - "Invalid tags for add action: {}", - estr, + "Invalid tags for add action: {estr}", )) })?; re.tags = Some(tags); @@ -352,8 +349,7 @@ impl MetaData { ) .map_err(|estr| { ActionError::InvalidField(format!( - "Invalid configuration for metaData action: {}", - estr, + "Invalid configuration for metaData action: {estr}", )) })?; } @@ -377,8 +373,7 @@ impl MetaData { ) .map_err(|estr| { ActionError::InvalidField(format!( - "Invalid format.options for metaData action: {}", - estr, + "Invalid format.options for metaData action: {estr}", )) })?; re.format.options = options; @@ -443,8 +438,7 @@ impl Remove { ) .map_err(|estr| { ActionError::InvalidField(format!( - "Invalid partitionValues for remove action: {}", - estr, + "Invalid partitionValues for remove action: {estr}", )) })?; re.partition_values = Some(partition_values); @@ -457,8 +451,7 @@ impl Remove { populate_hashmap_with_option_from_parquet_map(&mut tags, tags_map) .map_err(|estr| { ActionError::InvalidField(format!( - "Invalid tags for remove action: {}", - estr, + "Invalid tags for remove action: {estr}", )) })?; re.tags = Some(tags); @@ -598,8 +591,7 @@ impl Action { "cdc" => Action::cdc(AddCDCFile::from_parquet_record(col_data)?), name => { return Err(ActionError::InvalidField(format!( - "Unexpected action from checkpoint: {}", - name, + "Unexpected action from checkpoint: {name}", ))); } }) diff --git a/rust/src/checkpoints.rs b/rust/src/checkpoints.rs index 12fa3e032d..3d0ae2baf1 100644 --- a/rust/src/checkpoints.rs +++ b/rust/src/checkpoints.rs @@ -140,7 +140,7 @@ async fn create_checkpoint_for( let size = parquet_bytes.len() as i64; let checkpoint = CheckPoint::new(version, size, None); - let file_name = format!("{:020}.checkpoint.parquet", version); + let file_name = format!("{version:020}.checkpoint.parquet"); let checkpoint_path = storage.log_path().child(file_name); debug!("Writing checkpoint to {:?}.", checkpoint_path); diff --git a/rust/src/delta.rs b/rust/src/delta.rs index e214292227..3f311ff8e3 100644 --- a/rust/src/delta.rs +++ b/rust/src/delta.rs @@ -551,7 +551,7 @@ impl DeltaTable { /// Return the uri of commit version. pub fn commit_uri_from_version(&self, version: DeltaDataTypeVersion) -> Path { - let version = format!("{:020}.json", version); + let version = format!("{version:020}.json"); Path::from_iter(["_delta_log", &version]) } @@ -563,7 +563,7 @@ impl DeltaTable { match check_point.parts { None => { - let path = log_path.child(&*format!("{}.checkpoint.parquet", checkpoint_prefix)); + let path = log_path.child(&*format!("{checkpoint_prefix}.checkpoint.parquet")); checkpoint_data_paths.push(path); } Some(parts) => { @@ -1221,7 +1221,7 @@ impl fmt::Display for DeltaTable { writeln!(f, "\tversion: {}", self.version())?; match self.state.current_metadata() { Some(metadata) => { - writeln!(f, "\tmetadata: {}", metadata)?; + writeln!(f, "\tmetadata: {metadata}")?; } None => { writeln!(f, "\tmetadata: None")?; @@ -1383,7 +1383,7 @@ impl<'a> DeltaTransaction<'a> { // Write delta log entry as temporary file to storage. For the actual commit, // the temporary file is moved (atomic rename) to the delta log folder within `commit` function. let token = Uuid::new_v4().to_string(); - let file_name = format!("_commit_{}.json.tmp", token); + let file_name = format!("_commit_{token}.json.tmp"); let path = Path::from_iter(["_delta_log", &file_name]); self.delta_table.storage.put(&path, log_entry).await?; diff --git a/rust/src/delta_arrow.rs b/rust/src/delta_arrow.rs index 4e56208d00..fbb0bda033 100644 --- a/rust/src/delta_arrow.rs +++ b/rust/src/delta_arrow.rs @@ -100,8 +100,7 @@ impl TryFrom<&schema::SchemaDataType> for ArrowDataType { decimal if DECIMAL_REGEX.is_match(decimal) => { let extract = DECIMAL_REGEX.captures(decimal).ok_or_else(|| { ArrowError::SchemaError(format!( - "Invalid decimal type for Arrow: {}", - decimal + "Invalid decimal type for Arrow: {decimal}" )) })?; let precision = extract.get(1).and_then(|v| v.as_str().parse::().ok()); @@ -110,8 +109,7 @@ impl TryFrom<&schema::SchemaDataType> for ArrowDataType { // TODO how do we decide which variant (128 / 256) to use? (Some(p), Some(s)) => Ok(ArrowDataType::Decimal128(p, s)), _ => Err(ArrowError::SchemaError(format!( - "Invalid precision or scale decimal type for Arrow: {}", - decimal + "Invalid precision or scale decimal type for Arrow: {decimal}" ))), } } @@ -125,8 +123,7 @@ impl TryFrom<&schema::SchemaDataType> for ArrowDataType { Ok(ArrowDataType::Timestamp(TimeUnit::Microsecond, None)) } s => Err(ArrowError::SchemaError(format!( - "Invalid data type for Arrow: {}", - s + "Invalid data type for Arrow: {s}" ))), } } @@ -220,12 +217,10 @@ impl TryFrom<&ArrowDataType> for schema::SchemaDataType { ArrowDataType::Boolean => Ok(schema::SchemaDataType::primitive("boolean".to_string())), ArrowDataType::Binary => Ok(schema::SchemaDataType::primitive("binary".to_string())), ArrowDataType::Decimal128(p, s) => Ok(schema::SchemaDataType::primitive(format!( - "decimal({},{})", - p, s + "decimal({p},{s})" ))), ArrowDataType::Decimal256(p, s) => Ok(schema::SchemaDataType::primitive(format!( - "decimal({},{})", - p, s + "decimal({p},{s})" ))), ArrowDataType::Date32 => Ok(schema::SchemaDataType::primitive("date".to_string())), ArrowDataType::Timestamp(TimeUnit::Microsecond, None) => { @@ -270,8 +265,7 @@ impl TryFrom<&ArrowDataType> for schema::SchemaDataType { } } s => Err(ArrowError::SchemaError(format!( - "Invalid data type for Delta Lake: {}", - s + "Invalid data type for Delta Lake: {s}" ))), } } @@ -689,7 +683,7 @@ mod tests { fn test_arrow_from_delta_decimal_type() { let precision = 20; let scale = 2; - let decimal_type = format!["decimal({p},{s})", p = precision, s = scale]; + let decimal_type = format!["decimal({precision},{scale})"]; let decimal_field = crate::SchemaDataType::primitive(decimal_type); assert_eq!( >::try_from(&decimal_field).unwrap(), @@ -701,11 +695,8 @@ mod tests { fn test_arrow_from_delta_wrong_decimal_type() { let precision = 20; let scale = "wrong"; - let decimal_type = format!["decimal({p},{s})", p = precision, s = scale]; - let _error = format!( - "Invalid precision or scale decimal type for Arrow: {}", - scale - ); + let decimal_type = format!["decimal({precision},{scale})"]; + let _error = format!("Invalid precision or scale decimal type for Arrow: {scale}"); let decimal_field = crate::SchemaDataType::primitive(decimal_type); assert!(matches!( >::try_from(&decimal_field) diff --git a/rust/src/delta_config.rs b/rust/src/delta_config.rs index 92b9bc01a7..dd86cb5ae9 100644 --- a/rust/src/delta_config.rs +++ b/rust/src/delta_config.rs @@ -109,8 +109,7 @@ const SECONDS_PER_DAY: u64 = 24 * SECONDS_PER_HOUR; const SECONDS_PER_WEEK: u64 = 7 * SECONDS_PER_DAY; fn parse_interval(value: &str) -> Result { - let not_an_interval = - || DeltaConfigError::Validation(format!("'{}' is not an interval", value)); + let not_an_interval = || DeltaConfigError::Validation(format!("'{value}' is not an interval")); if !value.starts_with("interval ") { return Err(not_an_interval()); @@ -120,8 +119,7 @@ fn parse_interval(value: &str) -> Result { let number = parse_int(it.next().ok_or_else(not_an_interval)?)?; if number < 0 { return Err(DeltaConfigError::Validation(format!( - "interval '{}' cannot be negative", - value + "interval '{value}' cannot be negative" ))); } let number = number as u64; @@ -137,8 +135,7 @@ fn parse_interval(value: &str) -> Result { "week" => Duration::from_secs(number * SECONDS_PER_WEEK), unit => { return Err(DeltaConfigError::Validation(format!( - "Unknown unit '{}'", - unit + "Unknown unit '{unit}'" ))); } }; @@ -148,14 +145,14 @@ fn parse_interval(value: &str) -> Result { fn parse_int(value: &str) -> Result { value.parse().map_err(|e| { - DeltaConfigError::Validation(format!("Cannot parse '{}' as integer: {}", value, e)) + DeltaConfigError::Validation(format!("Cannot parse '{value}' as integer: {e}")) }) } fn parse_bool(value: &str) -> Result { - value.parse().map_err(|e| { - DeltaConfigError::Validation(format!("Cannot parse '{}' as bool: {}", value, e)) - }) + value + .parse() + .map_err(|e| DeltaConfigError::Validation(format!("Cannot parse '{value}' as bool: {e}"))) } #[cfg(test)] diff --git a/rust/src/operations/create.rs b/rust/src/operations/create.rs index c592cf6963..501ea31a70 100644 --- a/rust/src/operations/create.rs +++ b/rust/src/operations/create.rs @@ -334,7 +334,7 @@ mod tests { async fn test_create_local_relative_path() { let table_schema = get_delta_schema(); let name = Alphanumeric.sample_string(&mut rand::thread_rng(), 16); - let table = DeltaOps::try_from_uri(format!("./{}", name)) + let table = DeltaOps::try_from_uri(format!("./{name}")) .await .unwrap() .create() @@ -351,7 +351,7 @@ mod tests { let schema = get_delta_schema(); let name = Alphanumeric.sample_string(&mut rand::thread_rng(), 16); let table = CreateBuilder::new() - .with_location(format!("./{}", name)) + .with_location(format!("./{name}")) .with_columns(schema.get_fields().clone()) .await .unwrap(); diff --git a/rust/src/operations/transaction.rs b/rust/src/operations/transaction.rs index 64a70b5827..16e45f0e47 100644 --- a/rust/src/operations/transaction.rs +++ b/rust/src/operations/transaction.rs @@ -46,7 +46,7 @@ impl From for DeltaTableError { /// Return the uri of commit version. fn commit_uri_from_version(version: DeltaDataTypeVersion) -> Path { - let version = format!("{:020}.json", version); + let version = format!("{version:020}.json"); Path::from_iter([DELTA_LOG_FOLDER, &version]) } @@ -92,7 +92,7 @@ async fn prepare_commit( // Write delta log entry as temporary file to storage. For the actual commit, // the temporary file is moved (atomic rename) to the delta log folder within `commit` function. let token = uuid::Uuid::new_v4().to_string(); - let file_name = format!("_commit_{}.json.tmp", token); + let file_name = format!("_commit_{token}.json.tmp"); let path = Path::from_iter([DELTA_LOG_FOLDER, &file_name]); storage.put(&path, log_entry).await?; diff --git a/rust/src/optimize.rs b/rust/src/optimize.rs index 50a76722e4..5be72cdd93 100644 --- a/rust/src/optimize.rs +++ b/rust/src/optimize.rs @@ -320,9 +320,9 @@ fn get_target_file_size(table: &DeltaTable) -> DeltaDataTypeLong { } /// Build a Plan on which files to merge together. See [`Optimize`] -pub fn create_merge_plan<'a>( +pub fn create_merge_plan( table: &mut DeltaTable, - filters: &[PartitionFilter<'a, &str>], + filters: &[PartitionFilter<'_, &str>], target_size: Option, ) -> Result { let target_size = target_size.unwrap_or_else(|| get_target_file_size(table)); diff --git a/rust/src/partitions.rs b/rust/src/partitions.rs index 67b7652596..c5f263b2e3 100644 --- a/rust/src/partitions.rs +++ b/rust/src/partitions.rs @@ -151,7 +151,7 @@ impl<'a, T: std::fmt::Debug> TryFrom<(&'a str, &str, T)> for PartitionFilter<'a, value: PartitionValue::LessThanOrEqual(value), }), (_, _, _) => Err(DeltaTableError::InvalidPartitionFilter { - partition_filter: format!("{:?}", filter), + partition_filter: format!("{filter:?}"), }), } } @@ -174,7 +174,7 @@ impl<'a, T: std::fmt::Debug> TryFrom<(&'a str, &str, Vec)> for PartitionFilte value: PartitionValue::NotIn(value), }), (_, _, _) => Err(DeltaTableError::InvalidPartitionFilter { - partition_filter: format!("{:?}", filter), + partition_filter: format!("{filter:?}"), }), } } diff --git a/rust/src/schema.rs b/rust/src/schema.rs index 0449cadf3f..2851f3122c 100644 --- a/rust/src/schema.rs +++ b/rust/src/schema.rs @@ -77,8 +77,7 @@ impl SchemaTypeStruct { } let valid_fields: Vec = self.fields.iter().map(|f| f.name.clone()).collect(); Err(crate::DeltaTableError::Generic(format!( - "Unable to get field named \"{}\". Valid fields: {:?}", - name, valid_fields + "Unable to get field named \"{name}\". Valid fields: {valid_fields:?}" ))) } @@ -95,7 +94,7 @@ impl SchemaTypeStruct { if prefix.is_empty() { segment.to_owned() } else { - format!("{}.{}", prefix, segment) + format!("{prefix}.{segment}") } }; diff --git a/rust/src/storage/file.rs b/rust/src/storage/file.rs index 4b285b7346..c276cd781f 100644 --- a/rust/src/storage/file.rs +++ b/rust/src/storage/file.rs @@ -352,8 +352,8 @@ mod tests { assert!(!c.exists()); match rename_noreplace(a.to_str().unwrap(), c.to_str().unwrap()).await { Err(LocalFileSystemError::InvalidArgument {source, ..}) => - panic!("expected success, got: {:?}. Note: atomically renaming Windows files from WSL2 is not supported.", source), - Err(e) => panic!("expected success, got: {:?}", e), + panic!("expected success, got: {source:?}. Note: atomically renaming Windows files from WSL2 is not supported."), + Err(e) => panic!("expected success, got: {e:?}"), _ => {} } assert!(!a.exists()); diff --git a/rust/src/table_state.rs b/rust/src/table_state.rs index 9c8a3da089..1eaf862398 100644 --- a/rust/src/table_state.rs +++ b/rust/src/table_state.rs @@ -357,7 +357,7 @@ impl DeltaTableState { .all(|f| current_metadata.partition_columns.contains(&f.key.into())) { return Err(DeltaTableError::InvalidPartitionFilter { - partition_filter: format!("{:?}", filters), + partition_filter: format!("{filters:?}"), }); } diff --git a/rust/src/table_state_arrow.rs b/rust/src/table_state_arrow.rs index 34cdd362af..cc46693ca2 100644 --- a/rust/src/table_state_arrow.rs +++ b/rust/src/table_state_arrow.rs @@ -186,7 +186,7 @@ impl DeltaTableState { .into_iter() .zip(metadata.partition_columns.iter()) .map(|(array, name)| { - let name: Cow = Cow::Owned(format!("partition.{}", name)); + let name: Cow = Cow::Owned(format!("partition.{name}")); (name, array) }) .collect() @@ -257,7 +257,7 @@ impl DeltaTableState { Ok(arrow::record_batch::RecordBatch::try_from_iter( arrays .into_iter() - .map(|(key, array)| (format!("tags.{}", key), array)), + .map(|(key, array)| (format!("tags.{key}"), array)), )?) } else { Ok(arrow::record_batch::RecordBatch::try_from_iter(vec![( diff --git a/rust/src/writer/mod.rs b/rust/src/writer/mod.rs index d3e5fd2138..b590a6444e 100644 --- a/rust/src/writer/mod.rs +++ b/rust/src/writer/mod.rs @@ -1,7 +1,7 @@ #![cfg(all(feature = "arrow", feature = "parquet"))] //! Abstractions and implementations for writing data to delta tables -use crate::action::{Action, Add, ColumnCountStat, Stats}; +use crate::action::{Action, Add, ColumnCountStat}; use crate::{DeltaDataTypeVersion, DeltaTable, DeltaTableError}; use arrow::{datatypes::SchemaRef, datatypes::*, error::ArrowError}; @@ -54,12 +54,12 @@ pub(crate) enum DeltaWriterError { sample_error: ParquetError, }, - // TODO: derive Debug for Stats in delta-rs /// Serialization of delta log statistics failed. - #[error("Serialization of delta log statistics failed")] + #[error("Serialization of delta log statistics failed: {source}")] StatsSerializationFailed { - /// The stats object that failed serialization. - stats: Stats, + /// error raised during stats serialization. + #[from] + source: serde_json::Error, }, /// underlying object store returned an error. diff --git a/rust/src/writer/stats.rs b/rust/src/writer/stats.rs index 2ec3c5f8d3..779486dc4a 100644 --- a/rust/src/writer/stats.rs +++ b/rust/src/writer/stats.rs @@ -93,8 +93,7 @@ pub(crate) fn create_add( null_count: null_counts, }; - let stats_string = serde_json::to_string(&stats) - .or(Err(DeltaWriterError::StatsSerializationFailed { stats }))?; + let stats_string = serde_json::to_string(&stats)?; // Determine the modification timestamp to include in the add action - milliseconds since epoch // Err should be impossible in this case since `SystemTime::now()` is always greater than `UNIX_EPOCH` diff --git a/rust/src/writer/utils.rs b/rust/src/writer/utils.rs index 5738ed9268..e7af707344 100644 --- a/rust/src/writer/utils.rs +++ b/rust/src/writer/utils.rs @@ -40,7 +40,7 @@ impl PartitionPath { let partition_value = partition_value .as_deref() .unwrap_or(NULL_PARTITION_VALUE_DATA_PATH); - let part = format!("{}={}", k, partition_value); + let part = format!("{k}={partition_value}"); path_parts.push(part); } @@ -80,7 +80,7 @@ pub(crate) fn next_data_path( // TODO (roeap): my understanding is, that the values are used as a counter - i.e. if a single batch of // data written to one partition needs to be split due to desired file size constraints. let first_part = match part { - Some(count) => format!("{:0>5}", count), + Some(count) => format!("{count:0>5}"), _ => "00000".to_string(), }; let uuid_part = Uuid::new_v4(); @@ -88,17 +88,14 @@ pub(crate) fn next_data_path( let last_part = "c000"; // NOTE: If we add a non-snappy option, file name must change - let file_name = format!( - "part-{}-{}-{}.snappy.parquet", - first_part, uuid_part, last_part - ); + let file_name = format!("part-{first_part}-{uuid_part}-{last_part}.snappy.parquet"); if partition_columns.is_empty() { return Ok(Path::from(file_name)); } let partition_key = PartitionPath::from_hashmap(partition_columns, partition_values)?; - Ok(Path::from(format!("{}/{}", partition_key, file_name))) + Ok(Path::from(format!("{partition_key}/{file_name}"))) } /// Convert a vector of json values to a RecordBatch diff --git a/rust/tests/checkpoint_writer.rs b/rust/tests/checkpoint_writer.rs index 78c1e2ac2b..a494f238e2 100644 --- a/rust/tests/checkpoint_writer.rs +++ b/rust/tests/checkpoint_writer.rs @@ -369,10 +369,7 @@ mod checkpoints_with_tombstones { version: i64, ) -> (HashSet, Vec) { checkpoints::create_checkpoint(table).await.unwrap(); - let cp_path = format!( - "{}/_delta_log/0000000000000000000{}.checkpoint.parquet", - path, version - ); + let cp_path = format!("{path}/_delta_log/0000000000000000000{version}.checkpoint.parquet"); let (schema, actions) = read_checkpoint(&cp_path).await; let fields = schema diff --git a/rust/tests/read_delta_partitions_test.rs b/rust/tests/read_delta_partitions_test.rs index ff411ea86c..7f9a168d21 100644 --- a/rust/tests/read_delta_partitions_test.rs +++ b/rust/tests/read_delta_partitions_test.rs @@ -10,7 +10,7 @@ mod fs_common; #[test] fn test_create_delta_table_partition() { let year = "2021"; - let path = format!("year={}", year); + let path = format!("year={year}"); assert_eq!( deltalake::DeltaTablePartition::try_from(path.as_ref()).unwrap(), deltalake::DeltaTablePartition {