dcapwell commented on PR #2310: URL: https://github.com/apache/cassandra/pull/2310#issuecomment-1545981782
> Are we expecting these values to be primitive types Nope, this limitation was removed in the dev mailing list. The requirement is support for any type, including stuff like `map` and `text`. My stance is that the complexity for the type isn't more complex to have such a case, as a `ShortType` is variable length (don't know history on why... its fixed length but the type says its not...), so is `IntegerType`... so by allowing fixed and variable length types, we make sure that all primitive types work, and users can choose to use this type in other, non ML, use cases. > INSERT INTO t (pk, vec) VALUES (0, [1.0, sum(1.0, 2.0), 3.0]) I never remember how functions work in CQL... in most DBs I expect `sum(1, 2)` to be converted to `3` at binding time, but I think we defer these until execution time... ignoring this detail, conceptually yes, we should allow such behavior as long as the grammar allows (grammar doesn't allow functions in all places). If the grammar supports, I can work on a test to make sure this is handled. I actually created a CQL fuzz tester for Accord, but been debating if I should add to tree or not (there is overlap with what Harry does... which is why I question)... That fuzz tester builds a AST of what is allowed in CQL for each type, so would be a perfect way to make sure this behavior works... I tend to prefer generic/property tests rather than single type tests... which is why this patch is so large <_<... > If we disallow this (which would be my preference) we could simplify our type support greatly by removing the need for non-terminal support. My personal stance is that CQL is way too much special casing, so as a user I have a hard time knowing what to expect (I hate frozen vs multi-cell... they define their own semantics, so you have to know implementation details of the db...)... if the grammar allows functions in the value, then `VectorType` *must* allow as well... Thanks @mike-tr-adamson for the review, ill make a few changes and let you know when I push -- 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]

