LEFT and charindex:Cassandra

Viewed 38

What could be possible wrong with below query? I am trying to create a new column (author_ref) from existing column while stripping the all characters from left (column author_name) before space . Newbie to Cassandra.

Select author_name, LEFT(author_name, charindex(' ', author_name)) from [author_by_id] as author_ref;

author_short; TIA, H

1 Answers

Unless you have defined a user defined function called LEFT and CharIndex then it will not work, since there are no built in function of that name.

You can create custom functions although in this scenario, I would put the logic into the application / service and not push it to the database.

Related