ksql icon indicating copy to clipboard operation
ksql copied to clipboard

feat: extend INSERT/VALUES syntax for multiple rows

Open spena opened this issue 5 years ago • 5 comments

Description

Extends the INSERT ... VALUES syntax to accept multiple rows. For instance:

INSERT INTO foo VALUES (10), (11), (12);

The topic foo will contain three 3 rows (10, 11 and 12)

The above statement is equivalent to:

INSERT INTO foo VALUES (10);
INSERT INTO foo VALUES (11);
INSERT INTO foo VALUES (12);

Testing done

Modified unit tests Verified manually running the CLI

ksql> insert into t1(id) values (1),(2);
ksql> select * from t1 emit changes;
+-------------------------------------------+-------------------------------------------+-------------------------------------------+
|ROWTIME                                    |ROWKEY                                     |ID                                         |
+-------------------------------------------+-------------------------------------------+-------------------------------------------+
|1578687132771                              |null                                       |1                                          |
|1578687132796                              |null                                       |2                                          |

Reviewer checklist

  • [ ] Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • [ ] Ensure relevant issues are linked (description should include text like "Fixes #")

spena avatar Jan 10 '20 22:01 spena

@spena, now that we have a 5.4.0-post branch, do you want to re-target this PR to the 5.4.x branch?

JimGalasyn avatar Jan 16 '20 00:01 JimGalasyn

@agavra, now that we have a 5.4.0-post branch, do you want to re-target this PR to the 5.4.x branch?

JimGalasyn avatar Jan 16 '20 22:01 JimGalasyn

@JimGalasyn - I'm not sure this feature makes sense to backport to 5.4 as it's exclusively new functionality. Is there any reason we should do that?

agavra avatar Jan 16 '20 22:01 agavra

Ah you're right, it's a new feature, so it won't be going out with 5.4.1. Never mind!

JimGalasyn avatar Jan 16 '20 23:01 JimGalasyn

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar Nov 15 '23 20:11 cla-assistant[bot]