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

QCC testing investigation #646

Closed
wants to merge 51 commits into from
Closed
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6868a2b
Query Context Cache
sfc-gh-ext-simba-jy Sep 6, 2023
050afdf
fixed Parameter for Query Context Cache, and make serializeQueryConte…
sfc-gh-ext-simba-jy Sep 6, 2023
abce2ea
Edited Unit testing for the serializeQueryContext and fix some erros
sfc-gh-ext-simba-jy Sep 6, 2023
feb6e92
Removed Error message for Query Context Cache because it is not a con…
sfc-gh-ext-simba-jy Sep 6, 2023
3e059be
Moved the point of initializing the querycontext cache, and fixed som…
sfc-gh-ext-simba-jy Sep 8, 2023
543acb6
Fixed getQueryContextDTO
sfc-gh-ext-simba-jy Sep 8, 2023
dc5ae8c
fixed mock_http_client.js erro
sfc-gh-ext-simba-jy Sep 8, 2023
a041850
Removed unnecessary lines, and give some spaces between the codes and…
sfc-gh-ext-simba-jy Sep 8, 2023
1180686
Merge branch 'master' into contextcache
sfc-gh-ext-simba-jy Sep 11, 2023
7201a29
removed some dead codes
sfc-gh-ext-simba-jy Sep 12, 2023
376c937
removed a dead code
sfc-gh-ext-simba-jy Sep 12, 2023
bb55f99
Merge branch 'contextcache' of https://github.com/snowflakedb/snowfla…
sfc-gh-ext-simba-jy Sep 12, 2023
d2a1ca3
added connction testing for disableQueryContextCache
sfc-gh-ext-simba-jy Sep 13, 2023
bebcf05
Fixed typos, formats, comments
sfc-gh-ext-simba-jy Sep 14, 2023
2764315
Merge branch 'master' into contextcache
sfc-gh-ext-simba-jy Sep 14, 2023
f17d72e
passed whole QCE objects in the merge function and fixed some testing…
sfc-gh-ext-simba-jy Sep 16, 2023
3222807
Merge branch 'master' into contextcache
sfc-gh-ext-simba-jy Sep 18, 2023
dd9da02
Added integration test
sfc-gh-ext-simba-jy Sep 19, 2023
b827f5c
edited some variable names in the QCC testing
sfc-gh-ext-simba-jy Sep 19, 2023
0268c02
Remove queryContextDTO from requests
sfc-gh-ext-simba-jy Sep 19, 2023
3a619fe
fixed integration tests and removed comments
sfc-gh-ext-simba-jy Sep 19, 2023
d02f273
Removed getLogLevelTag funcrtion
sfc-gh-ext-simba-jy Sep 20, 2023
85540ff
Fixed the network error and reverted back queryContexDTO to the origi…
sfc-gh-ext-simba-jy Sep 21, 2023
42af59c
Removed unnecessary spaces between two classes
sfc-gh-ext-simba-jy Sep 21, 2023
6844666
Merge branch 'master' into contextcache
sfc-gh-ext-simba-jy Sep 21, 2023
a9820a6
increased the testing timeout
sfc-gh-ext-simba-jy Sep 21, 2023
e84eef9
Added logging options for testing
sfc-gh-ext-simba-jy Sep 21, 2023
de7fb4f
reduced the number of testing
sfc-gh-ext-simba-jy Sep 21, 2023
e28fea0
Removed creating DB for testing
sfc-gh-ext-simba-jy Sep 21, 2023
5492ad7
added details logging
sfc-gh-ext-simba-jy Sep 21, 2023
de659de
only testing qcc
sfc-gh-ext-simba-jy Sep 21, 2023
f2051a9
testing
sfc-gh-ext-simba-jy Sep 21, 2023
cc989f7
testing
sfc-gh-ext-simba-jy Sep 21, 2023
a2491fc
testing
sfc-gh-ext-simba-jy Sep 21, 2023
df81d29
testing
sfc-gh-ext-simba-jy Sep 21, 2023
eb0c94f
testing
sfc-gh-ext-simba-jy Sep 21, 2023
a0bc57a
testing
sfc-gh-ext-simba-jy Sep 21, 2023
3caece6
testing
sfc-gh-ext-simba-jy Sep 22, 2023
1a4e0ef
pulled request
sfc-gh-ext-simba-jy Sep 22, 2023
012ccf0
Merge branch 'master' into qccissue
sfc-gh-ext-simba-jy Sep 22, 2023
13ba12c
testing
sfc-gh-ext-simba-jy Sep 22, 2023
5a6e052
testing
sfc-gh-ext-simba-jy Sep 22, 2023
8be5ddc
testing
sfc-gh-ext-simba-jy Sep 22, 2023
1f4c1d2
added retry
sfc-gh-ext-simba-jy Sep 22, 2023
eef84ea
testing
sfc-gh-ext-simba-jy Sep 22, 2023
3d4ef32
testing
sfc-gh-ext-simba-jy Sep 22, 2023
9a0fce5
testing'
sfc-gh-ext-simba-jy Sep 22, 2023
381bfa3
Delete testing.js
sfc-gh-ext-simba-jy Sep 23, 2023
7dbc935
Delete QueryContexttesting.js
sfc-gh-ext-simba-jy Sep 23, 2023
1fb5cad
testings
sfc-gh-ext-simba-jy Sep 23, 2023
3235d28
Merge branch 'qccissue' of https://github.com/snowflakedb/snowflake-c…
sfc-gh-ext-simba-jy Sep 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 92 additions & 78 deletions test/integration/testHTAP.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,93 +6,107 @@ const assert = require('assert');
const async = require('async');
const connOption = require('./connectionOptions').valid;
const testUtil = require('./testUtil');
const { configureLogger } = require('../configureLogger');
const Logger = require('../../lib/logger');

// Only the AWS servers support the hybrid table in the GitHub action.
if (process.env.CLOUD_PROVIDER === 'AWS') {
describe('Query Context Cache test', function () {
let connection;

before(async () => {
connection = testUtil.createConnection(connOption);
await testUtil.connectAsync(connection);
});

after(async () => {
await testUtil.destroyConnectionAsync(connection);
});
if(process.env.CLOUD_PROVIDER === 'AWS') {
describe('Query Context Cache test', function () {
this.retries(5);
let connection;
beforeEach(async () => {
connection = testUtil.createConnection(connOption);
testUtil.connectAsync(connection);
});

after(async () => {
configureLogger('ERROR');
await testUtil.destroyConnectionAsync(connection);
});
const querySet = [
{
sqlTexts: [
'create or replace database qcc_test_db1',
'create or replace hybrid table t1 (a int primary key, b int)',
'insert into t1 values (1, 2), (2, 3), (3, 4)'
],
QccSize: 2,
},
{
sqlTexts: [
'create or replace database qcc_test_db2',
'create or replace hybrid table t2 (a int primary key, b int)',
'insert into t2 values (1, 2), (2, 3), (3, 4)'
],
QccSize: 3,
},
{
sqlTexts: [
'create or replace database qcc_test_db3',
'create or replace hybrid table t3 (a int primary key, b int)',
'insert into t3 values (1, 2), (2, 3), (3, 4)'
],
QccSize: 4,
},
// {
// sqlTexts: [
// 'select * from qcc_test_db1.public.t1 x, qcc_test_db2.public.t2 y, qcc_test_db3.public.t3 z where x.a = y.a and y.a = z.a;',
// 'select * from qcc_test_db1.public.t1 x, qcc_test_db2.public.t2 y where x.a = y.a;',
// 'select * from qcc_test_db2.public.t2 y, qcc_test_db3.public.t3 z where y.a = z.a;'
// ],
// QccSize: 4,
// },
];

const querySet = [
{
sqlTexts: [
'create or replace database db1',
'create or replace hybrid table t1 (a int primary key, b int)',
'insert into t1 values (1, 2), (2, 3), (3, 4)'
],
QccSize: 2,
},
{
sqlTexts: [
'create or replace database db2',
'create or replace hybrid table t2 (a int primary key, b int)',
'insert into t2 values (1, 2), (2, 3), (3, 4)'
],
QccSize: 3,
},
{
sqlTexts: [
'create or replace database db3',
'create or replace hybrid table t3 (a int primary key, b int)',
'insert into t3 values (1, 2), (2, 3), (3, 4)'
],
QccSize: 4,
},
{
sqlTexts: [
'select * from db1.public.t1 x, db2.public.t2 y, db3.public.t3 z where x.a = y.a and y.a = z.a;',
'select * from db1.public.t1 x, db2.public.t2 y where x.a = y.a;',
'select * from db2.public.t2 y, db3.public.t3 z where y.a = z.a;'
],
QccSize: 4,
},
];

function createQueryTest() {
const testingSet = [];
let testingfunction;
for (let i = 0; i < querySet.length; i++) {
const { sqlTexts, QccSize } = querySet[i];
for (let k = 0; k < sqlTexts.length; k++){
if (k !== sqlTexts.length - 1){
testingfunction = function (callback) {
connection.execute({
sqlText: sqlTexts[k],
complete: function (err) {
assert.ok(!err, 'There should be no error!');
callback();
function createQueryTest () {
const testingSet = [];
let testingfunction;
for(let i = 0; i < querySet.length; i++) {
const {sqlTexts,QccSize} = querySet[i];
for(let k = 0; k < sqlTexts.length; k++){
if(k!==sqlTexts.length-1){
testingfunction = function(callback) {
connection.execute({
sqlText: sqlTexts[k],
complete: function (err) {
if(err){

Logger.getInstance().trace("The error occurs for the testHTAPs", err.message);
}
});
};
} else {
testingfunction = function (callback) {
connection.execute({
sqlText: sqlTexts[k],
complete: function (err, stmt) {
assert.ok(!err, 'There should be no error!');
assert.strictEqual(stmt.getQueryContextCacheSize(), QccSize);
assert.strictEqual(stmt.getQueryContextDTOSize(), QccSize);
callback();
Logger.getInstance().trace("Provider", process.env.CLOUD_PROVIDER);

assert.ok(!err,'There should be no error!');
callback();
}
});
};
}
else{
testingfunction = function(callback) {
connection.execute({
sqlText: sqlTexts[k],
complete: function (err, stmt) {
if(err){
Logger.getInstance().trace("The error occurs for the testHTAP", err.message);
}
});
};
}
testingSet.push(testingfunction);
assert.ok(!err,'There should be no error!');
assert.strictEqual(stmt.getQueryContextCacheSize(), QccSize);
assert.strictEqual(stmt.getQueryContextDTOSize(), QccSize);
callback();
}
});
};
}
testingSet.push(testingfunction);
}
return testingSet;
}
return testingSet;
}

it('test Query Context Cache', function (done) {
async.series(createQueryTest(), done);
});
it('test Query Context Cache', function (done) {
const queryTests = createQueryTest();
async.series(queryTests,done);
});
});
}
Loading