manticoresoftware / manticoresoftware/manticoresearch

SQL: UPDATE index SET field = other_field 1

Open
#810 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12k
Forks
642
Avg merge
3d 12h
Merged PRs (30d)
47

Description

In an online shop, for prices we often use different currencies converted to a single currency for comparison. When the currency exchange rate changes, we want to run a statement as such (to update the EUR price converted to USD for all documents):

UPDATE index SET price_usd = price_in_original_currency * 1.25 WHERE currency = 'EUR';  

But we get the error:
syntax error, unexpected identifier near 'price_in_original_currency * 1.25'

So the feature request is:
For an UPDATE...SET query, please allow using the a field as the new value (with simple arithmetic expressions).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the UPDATE index SET query shown in the issue and trace how UPDATE...SET values are parsed and evaluated. Identify the relevant SQL parser and update execution entry points in the repository; done means field references and simple arithmetic expressions work for the demonstrated currency conversion without breaking existing UPDATE statements.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.