QuakeWang commented on code in PR #411:
URL: https://github.com/apache/paimon-rust/pull/411#discussion_r3484963343
##########
crates/paimon/src/btree/key_serde.rs:
##########
@@ -109,6 +109,12 @@ pub fn make_key_comparator(data_type: &DataType) ->
KeyComparator {
let bv = i64::from_le_bytes(b[..8].try_into().unwrap());
av.cmp(&bv)
}),
+ // VECTOR is not a valid key type. Fail loudly rather than letting it
fall
+ // into the lexicographic byte comparator below, which would silently
sort
+ // vectors incorrectly.
+ DataType::Vector(_) => {
+ panic!("VECTOR columns are not supported as BTree keys")
Review Comment:
`VECTOR` can still pass schema key validation and reach this comparator as a
primary/key-index type, so this turns an unsupported schema into a runtime
panic. Please reject `VECTOR` earlier with a normal `Unsupported`/config error,
or change comparator creation to return `Result` instead of panicking.
--
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]