Riza Suminto has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/21463 )

Change subject: IMPALA-13106: Support larger imported query profile sizes 
through compression
......................................................................


Patch Set 4: Code-Review+1

(2 comments)

http://gerrit.cloudera.org:8080/#/c/21463/4/www/scripts/queries/profileParseWorker.js
File www/scripts/queries/profileParseWorker.js:

http://gerrit.cloudera.org:8080/#/c/21463/4/www/scripts/queries/profileParseWorker.js@22
PS4, Line 22: try {
            :     var profile = JSON.parse(e.data).contents;
            :     var val = profile.profile_name;
            :     var query = {};
            :     query.id = val.substring(val.indexOf("=") + 1, val.length - 
1);
            :     query.user = profile.child_profiles[0].info_strings
            :         .find(({key}) => key === "User").value;
            :     query.default_db = profile.child_profiles[0].info_strings
            :         .find(({key}) => key === "Default Db").value;
            :     query.type = profile.child_profiles[0].info_strings
            :         .find(({key}) => key === "Query Type").value;
            :     query.start_time = profile.child_profiles[0].info_strings
            :         .find(({key}) => key === "Start Time").value;
            :     query.end_time = profile.child_profiles[0].info_strings
            :         .find(({key}) => key === "End Time").value;
            :     query.bytes_read = profile.child_profiles[2].counters
            :         .find(({counter_name}) => counter_name === 
"TotalBytesRead").value;
            :     query.bytes_read = getReadableSize(query.bytes_read, 2);
            :     query.bytes_sent = profile.child_profiles[2].counters
            :         .find(({counter_name}) => counter_name === 
"TotalBytesSent").value;
            :     query.bytes_sent = getReadableSize(query.bytes_sent, 2);
            :     query.state = profile.child_profiles[0].info_strings
            :         .find(({key}) => key === "Query State").value;
            :     query.rows_fetched = profile.child_profiles[1].counters
            :         .find(({counter_name}) => counter_name === 
"NumRowsFetched").value;
            :     query.resource_pool = profile.child_profiles[0].info_strings
            :         .find(({key}) => key === "Request Pool").value;
            :     query.statement = profile.child_profiles[0].info_strings
            :         .find(({key}) => key === "Sql Statement").value;
            :     query.statement = query.statement.substring(0, 250) + "...";
            :     query.profile = pako.deflate(e.data, {level : 3});
            :   } catch (err) {
            :     query.error = err;
            :   }
What about wrapping these as a function, and test that function in 
profileParseWorker.test.js?


http://gerrit.cloudera.org:8080/#/c/21463/4/www/scripts/tests/queries/profileParseWorker.test.js
File www/scripts/tests/queries/profileParseWorker.test.js:

http://gerrit.cloudera.org:8080/#/c/21463/4/www/scripts/tests/queries/profileParseWorker.test.js@28
PS4, Line 28: import("../../../pako.min.js").then((pako) => {
            :       pako = pako.default;
            :       expect(pako.inflate(pako.deflate(exampleJSONProfileText, 
{level : 3}), {to : "string"}))
            :           .toBe(exampleJSONProfileText);
            :     });
> We cannot use/instantiate web workers in JEST framework or most other testi
Ack



--
To view, visit http://gerrit.cloudera.org:8080/21463
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8c4f31beb9cac89051460bf764b6d50c3933bd03
Gerrit-Change-Number: 21463
Gerrit-PatchSet: 4
Gerrit-Owner: Surya Hebbar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Kurt Deschler <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>
Gerrit-Reviewer: Surya Hebbar <[email protected]>
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>
Gerrit-Comment-Date: Tue, 11 Jun 2024 23:35:29 +0000
Gerrit-HasComments: Yes

Reply via email to