-
Notifications
You must be signed in to change notification settings - Fork 83
fix(package): Refactor dataset handling in the package. #1023
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
Changes from 1 commit
0d186e6
75ac0ff
bb1e5f4
ba7cfe1
68454c6
c1de746
d797198
8c39e77
d570ab6
398ab5e
7759a7a
e6b8cc7
7a468c3
1dd1cea
a0c3c29
a9bf615
fe05f5f
39a9278
7124828
eb80992
5ed44e7
af6b508
67fb01f
d6ad4de
ff7d700
7ffc77c
0255cbd
1076a3f
71c4d82
6bd9372
84df2e2
983bea1
bdb7817
a82a267
f699496
90ce0a4
d6f9e5a
dc6a706
76bcb4a
a4e6f83
7b42568
afe43ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| { | ||
| "ClpStorageEngine": "clp", | ||
|
|
||
| "SqlDbHost": "localhost", | ||
| "SqlDbPort": 3306, | ||
| "SqlDbName": "clp-db", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // NOTE: These settings are duplicated from components/webui/client/src/config/index.ts, but will be | ||
| // removed in the near future. | ||
| const CLP_STORAGE_ENGINE_CLP_S = "clp-s"; | ||
| const CLP_DEFAULT_DATASET_NAME = "default"; | ||
|
|
||
| export { | ||
| CLP_DEFAULT_DATASET_NAME, | ||
| CLP_STORAGE_ENGINE_CLP_S, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,11 @@ import { | |||||||||||||||||||||||||||||
| ResultSetHeader, | ||||||||||||||||||||||||||||||
| } from "mysql2/promise"; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| import settings from "../../settings.json"; | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||
| CLP_DEFAULT_DATASET_NAME, | ||||||||||||||||||||||||||||||
| CLP_STORAGE_ENGINE_CLP_S, | ||||||||||||||||||||||||||||||
| } from "../configConstants.js"; | ||||||||||||||||||||||||||||||
| import {Nullable} from "../typings/common.js"; | ||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||
| DbManagerOptions, | ||||||||||||||||||||||||||||||
|
|
@@ -125,6 +130,9 @@ class DbManager { | |||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
| } else if (QUERY_JOB_TYPE.EXTRACT_JSON === jobType) { | ||||||||||||||||||||||||||||||
| jobConfig = { | ||||||||||||||||||||||||||||||
| dataset: CLP_STORAGE_ENGINE_CLP_S === settings.ClpStorageEngine ? | ||||||||||||||||||||||||||||||
| CLP_DEFAULT_DATASET_NAME : | ||||||||||||||||||||||||||||||
| null, | ||||||||||||||||||||||||||||||
| archive_id: streamId, | ||||||||||||||||||||||||||||||
| target_chunk_size: targetUncompressedSize, | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
Comment on lines
132
to
138
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Avoid sending a Down-stream scheduler components typically look for the - jobConfig = {
- dataset: CLP_STORAGE_ENGINE_CLP_S === settings.ClpStorageEngine ?
- CLP_DEFAULT_DATASET_NAME :
- null,
- archive_id: streamId,
- target_chunk_size: targetUncompressedSize,
- };
+ jobConfig = {
+ archive_id: streamId,
+ target_chunk_size: targetUncompressedSize,
+ ...(CLP_STORAGE_ENGINE_CLP_S === settings.ClpStorageEngine && {
+ dataset: CLP_DEFAULT_DATASET_NAME,
+ }),
+ };This keeps the payload minimal and makes future schema evolution easier. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it better to use an enum like
then compare the values against
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better to move stuff from this file into the typings directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have this enum in the client code. This constant is just temporary to keep the webui working in this PR. In #1050, we're going to pass the dataset from the client code, so the logic int he last two commits can be reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or are you suggesting we duplicate the entire enum in the serve code for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right i was going to suggest reusing / duplicating this enum: https://github.com/haiqi96/clp_fork/blob/7b42568fa9d335ecbe85f13edc5d3c111b4e8587/components/webui/client/src/config/index.ts
sure. in that case i think we can temporarily leave the constant as-is then