Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Venice Primitive keys #83

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Support Venice Primitive keys #83

merged 2 commits into from
Jan 10, 2025

Conversation

jogrogan
Copy link
Collaborator

@jogrogan jogrogan commented Jan 10, 2025

  • Support Primitive Venice Keys
  • Add Template option for empty string defaults
  • Add template & key option testing

Global templates were causing problems with keys getting overwritten, see example below:

Without change:

0: Hoptimator> !pipeline insert into "VENICE-CLUSTER0"."test-store" ("KEY$id", "intField") select "KEY", "intField" from "VENICE-CLUSTER0"."test-store-primitive"
CREATE TABLE IF NOT EXISTS `test-store-primitive` (`intField` INTEGER, `stringField` VARCHAR, `KEY` INTEGER) WITH ('connector'='venice', 'key.fields'='KEY_id', 'key.fields-prefix'='KEY_', 'key.type'='RECORD', 'partial-update-mode'='true', 'storeName'='test-store-primitive', 'value.fields-include'='EXCEPT_KEY');
CREATE TABLE IF NOT EXISTS `test-store` (`intField` INTEGER, `stringField` VARCHAR, `KEY_id` INTEGER) WITH ('connector'='venice', 'key.fields'='KEY_id', 'key.fields-prefix'='KEY_', 'key.type'='RECORD', 'partial-update-mode'='true', 'storeName'='test-store', 'value.fields-include'='EXCEPT_KEY');
INSERT INTO `test-store` (`intField`, `KEY_id`) SELECT `intField`, `KEY` AS `KEY_id` FROM `VENICE-CLUSTER0`.`test-store-primitive`;

With change:

0: Hoptimator> !pipeline insert into "VENICE-CLUSTER0"."test-store" ("KEY$id", "intField") select "KEY", "intField" from "VENICE-CLUSTER0"."test-store-primitive"
CREATE TABLE IF NOT EXISTS `test-store-primitive` (`intField` INTEGER, `stringField` VARCHAR, `KEY` INTEGER) WITH ('connector'='venice', 'key.fields'='KEY', 'key.fields-prefix'='', 'key.type'='PRIMITIVE', 'partial-update-mode'='true', 'storeName'='test-store-primitive', 'value.fields-include'='EXCEPT_KEY');
CREATE TABLE IF NOT EXISTS `test-store` (`intField` INTEGER, `stringField` VARCHAR, `KEY_id` INTEGER) WITH ('connector'='venice', 'key.fields'='KEY_id', 'key.fields-prefix'='KEY_', 'key.type'='RECORD', 'partial-update-mode'='true', 'storeName'='test-store', 'value.fields-include'='EXCEPT_KEY');
INSERT INTO `test-store` (`intField`, `KEY_id`) SELECT `intField`, `KEY` AS `KEY_id` FROM `VENICE-CLUSTER0`.`test-store-primitive`;

@jogrogan jogrogan merged commit 574be65 into main Jan 10, 2025
1 check passed
@jogrogan jogrogan deleted the jogrogan/venicePrimitiveKey branch January 10, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants